Reputation: 1852
All,
I must have a fundamental neuron missing, but I cannot get a simple program to load a PNG file and display it in a window. I'm not sure if it is a QPixmap, a QPicture, or what. All of the samples in the QTCreator are a bit more than I need right now. Baby steps...
I can get the window to display, and the program doesn't barf when I try to load the PNG, but it never gets displayed.
If someone would post a simple program to load a PNG from a file and display it, it would greatly appreciated. (I know, asking a lot, but...).
Thanks!
:bp:
Upvotes: 0
Views: 308
Reputation: 5416
this example is minimal: http://doc.trolltech.com/4.6/widgets-imageviewer.html
You will want to have a look at the function ImageViewer::open()
:
QPixmap::fromImage()
;QLabel::setPixmap()
.The QImage object will automatically chose an appropriate reader according to the format of the image it detects in step 1.
Upvotes: 1