title: QPainter mirror image not working
body: <p>I have a program which functions similar to paint, and I have a change request as such:</p>
  
  <p>Add a new function named mirror mode, in a mirror mode, the canvas is divided by left and right half. All the pictures that are drawn in one of the half should be mirrored to the opposite half. </p>
  
  <p>I have added code such that the mirrored portion appears; however the original image does not appear to be drawn by QPainter. Is there a simple thing I'm missing to get QPainter to show both the mirrored image and drawn image. The relevant source code is as follows : </p>
  
  <pre><code>//
  void ImageArea::paintEvent(QPaintEvent *event)
  {
      QPainter *painter = new QPainter();
      painter-&gt;begin(this);
  
      QRect *rect = new QRect(event-&gt;rect());
  
      painter-&gt;setBrush(QBrush(QPixmap(":media/textures/transparent.jpg")));
      painter-&gt;drawRect(0, 0,
                    mImage-&gt;rect().right() - 1,
                    mImage-&gt;rect().bottom() - 1);
  
  
      painter-&gt;drawImage(event-&gt;rect(), *mImage, event-&gt;rect());
      painter-&gt;setPen(Qt::NoPen);
      painter-&gt;setBrush(QBrush(Qt::black));
      painter-&gt;drawRect(QRect(mImage-&gt;rect().right(),
                              mImage-&gt;rect().bottom(), 6, 6));
      painter-&gt;drawImage(event-&gt;rect(), *mImage, event-&gt;rect());
      painter-&gt;end();
      painter-&gt;begin(this);
  
      QImage tmp(mImage-&gt;mirrored(true,false));
      painter-&gt;drawImage(0, 0, tmp);
      painter-&gt;end();
  
  
  
  }
  </code></pre>