Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some words on installation.
[graphlib.git] / exemple.cpp
index ce402e5..d4722e7 100644 (file)
@@ -1,26 +1,32 @@
 /*
- * Pour compiler
- * =============
+ * Pour compiler et exécuter
+ * =========================
  *
- * 1. Créer le fichier hello.pro :
- *      +------------------------------------------------------------+
- *      |TARGET = hello                                              |
- *      |CONFIG += qt debug                                          |
- *      |SOURCES += hello.cc                                         |
- *      +------------------------------------------------------------+
+ * 1. Créer le fichier exemple.pro :
+ *    ,----
+ *    |TEMPLATE = app
+ *    |TARGET = exemple
+ *    |CONFIG += qt
+ *    |CONFIG += debug
+ *    |HEADERS += DrawingWindow.h
+ *    |SOURCES += DrawingWindow.cpp
+ *    |SOURCES += exemple.cpp
+ *    `----
  *
- * 2. Créer le fichier Makefile avec la commande :
- *      $ qmake -makefile hello.pro
+ * 2. Créer le fichier Makefile avec la commande :
+ *      $ qmake-qt4 exemple.pro
  *    ou tout simplement :
- *      $ qmake -makefile
+ *      $ qmake-qt4
  *
  * 3. Compiler avec la commande :
- *      $ make hello
- *    ou tou simplement :
+ *      $ make exemple
+ *    ou tout simplement :
  *      $ make
+ *
+ * 4. Exécuter le programme avec la commande :
+ *      $ ./exemple
  */
 
-
 #include <QApplication>
 #include <DrawingWindow.h>
 #include <algorithm>
@@ -31,7 +37,7 @@ float frand()
     return rand() / (float )RAND_MAX;
 }
 
-void exemple1(DrawingWindow &w)
+void exemple1(DrawingWindoww)
 {
     const int cx = w.width / 2;
     const int cy = w.height / 2;
@@ -46,7 +52,7 @@ void exemple1(DrawingWindow &w)
     }
 }
 
-void exemple2(DrawingWindow &w)
+void exemple2(DrawingWindoww)
 {
     int width = std::min(w.width, w.height) / 2;
     for (int z = 0; z <= width; z++) {
@@ -72,7 +78,7 @@ void exemple2(DrawingWindow &w)
     }
 }
 
-void exemple3(DrawingWindow &w)
+void exemple3(DrawingWindoww)
 {
     while (1) {
         int x1 = rand() % w.width;