Quote Originally Posted by krivenok
Why this code is incorrect?
Why image doesn't painting in frame?
  1. Everything you draw on a hidden widget will be discarded.
  2. Make sure you have JPEG image format plugin compiled
  3. The docs say:
    Warning: Unless a widget has the Qt::WA_PaintOutsidePaintEvent attribute set. A QPainter can only be used on a widget inside a paintEvent() or a function called by a paintEvent(). On Mac OS X, you can only paint on a widget in a paintEvent() regardless of this attribute's setting.


If you want to show an image, use QLabel and the QLabel::setPixmap() method.