The simplest way to display an image is to use a QLabel and a QPixmap:
According to Qt doc:
QImage is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen
int main(int argc, char** argv)
{
imageLabel.setPixmap(image);
label.show();
return app.exec();
}
int main(int argc, char** argv)
{
QApplication app(argc, argv);
QPixmap image("image.jpg");
QLabel imageLabel();
imageLabel.setPixmap(image);
label.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks