(C++ Qt Creator) Showing an image
February 24, 2017 · View on GitHub
(C++ Qt Creator) Showing an image
Example to do 2D graphics like this screenshot.
#include <QApplication> #include <QLabel> #include <QPixmap> int main(int argc, char* argv[]) { QApplication application(argc,argv); QLabel label; QPixmap pixmap("CppRainbow.PNG"); label.setPixmap(pixmap); label.show(); return application.exec(); }
#------------------------------------------------- # # Project created by QtCreator 2010-05-06T17:18:10 # #------------------------------------------------- TARGET = ProjectQtPixmap CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp