title: qt trouble overriding paintEvent
body: <p>I'm subclassing QProgressBar in a custom widget, and I overwrote the <b>paintEvent</b> method with the following code :</p>
  
  <pre><code>
  void myProg::paintEvent(QPaintEvent *pe)
  {
      QProgressBar::paintEvent(pe);
      QRect region = pe-&gt;rect();
      QPainter *painter = new QPainter(this);
      QPen *pen = new QPen;
      painter-&gt;begin(this);
      painter-&gt;setBrush(Qt::red);
      int x = this-&gt;x();
      int y = this-&gt;y();
      pen-&gt;setWidth(10);
      painter-&gt;setPen(*pen);
      painter-&gt;drawLine(x,y,x+100,y);
      painter-&gt;end();
  
  }
  </code></pre>
  
  <p>I'm trying to display a red line, as a starting point, to see that I can add my own modifications to the widget. However, this isn't working. I only see the widget as a regular QProgressBar. Any ideas on what could be wrong ?</p>