Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(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 file:

 

#-------------------------------------------------
#
# Project created by QtCreator 2010-05-06T17:18:10
#
#-------------------------------------------------
TARGET = ProjectQtPixmap
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict