5 * 1. Créer le fichier hello.pro :
6 * +------------------------------------------------------------+
8 * |CONFIG += qt debug |
9 * |SOURCES += hello.cc |
10 * +------------------------------------------------------------+
12 * 2. Créer le fichier Makefile avec la commande :
13 * $ qmake -makefile hello.pro
14 * ou tout simplement :
17 * 3. Compiler avec la commande :
24 #include <QApplication>
26 #include <DrawingArea.h>
27 #include <DrawingThread.h>
28 #include <DrawingWindow.h>
32 int main_drawing_thread(DrawingArea &a)
34 std::cout << "[ " << a.width() << " x " << a.height() << " ]\n";
39 std::cerr << "loooooooooooooooooooooop "
40 << y << " (" << c << ")\n";
42 for (int yy = y; yy < y + 10; yy++)
43 for (int x = 0; x < a.width(); x++)
45 if ((y += 10) >= a.height()) {
54 int main(int argc, char *argv[])
56 QApplication application(argc, argv);
57 DrawingArea drawingArea(800, 600);
58 DrawingWindow drawingWindow(drawingArea);
59 DrawingThread drawingThread(drawingArea, main_drawing_thread);
62 drawingThread.start();
64 return application.exec();