From: giersch Date: Sat, 24 Nov 2007 11:02:02 +0000 (+0000) Subject: . X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/commitdiff_plain/1b52f751d39d08a4276c5fdca034d8888b2c550a . --- diff --git a/Doxyfile b/Doxyfile index 3a5378f..fba7760 100644 --- a/Doxyfile +++ b/Doxyfile @@ -500,7 +500,7 @@ EXCLUDE_PATTERNS = # directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = ./ minimal/ # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp diff --git a/DrawingWindow.cpp b/DrawingWindow.cpp index 7c63c86..fe759a8 100644 --- a/DrawingWindow.cpp +++ b/DrawingWindow.cpp @@ -4,6 +4,69 @@ #include #include +/*! \mainpage + * + * Bla bla bla... + */ + +/*! \class DrawingWindow + * \brief Fenêtre de dessin. + * + * \author Arnaud Giersch + * \date novenbre 2007 + * + * Cette classe décrit un widget Qt permettant d'écrire des + * applications graphiques simples. Pour cela, il faut définir une + * fonction de dessin. Cette fonction ne retourne rien et prend comme + * unique paramètre une référence vers un objet de class + * DrawingWindow. + * + * La fonction devra ensuite être passée en paramètre pour les + * constructeurs de la classe, ainsi que les dimension requises pour + * la fenêtre graphique. Le programme est ensuite compilé comme + * n'importe programme Qt. + * + * Concrètement, la fonction sera exécutée dans un nouveau thread, + * tandis que le thread principal s'occupera de la gestion des + * évènements et du rendu. + */ + +/*! \example hello.cpp + * + * Voir le code source à la fin de la page. Pour compiler et exécuter + * ce programme, il faut : + * + * 1. Créer le fichier \c hello.pro + * + * Pour simplifier, ce fichier contient la liste des fichiers sources + * composant le programme. + * + * \include hello.pro + * + * 2. Créer le fichier \c Makefile avec la commande : + * + * \verbatim qmake-qt4 hello.pro \endverbatim + * ou tout simplement : + * \verbatim qmake-qt4 \endverbatim + * + * 3. Compiler le programme avec la commande : + * + * \verbatim make hello \endverbatim + * ou tout simplement : + * \verbatim make \endverbatim + * + * 4. Exécuter le programme avec la commande : + * + * \verbatim ./exemple \endverbatim + * + * Code source de l'exemple + */ + +/*! \example exemple.cpp + * + * Un exemple un peu plus sophistiqué. + */ + //! Classe de thread. class DrawingThread: public QThread { public: @@ -56,10 +119,8 @@ public: //--- DrawingWindow ---------------------------------------------------- -/*! \class DrawingWindow - * \brief Fenêtre de dessin. - * - * Bla bla bla +/*! \file DrawingWindow.h + * \brief Classe DrawingWindow. */ /*! \typedef DrawingWindow::ThreadFunction diff --git a/INSTALL b/INSTALL index 1e464a7..58968af 100755 --- a/INSTALL +++ b/INSTALL @@ -7,7 +7,7 @@ SRC = DrawingWindow.h DrawingWindow.cpp exemple.cpp exemple.pro .PHONY: install install: - install -m 644 $(SRC) $(DEST) doxygen Doxyfile + install -m 644 $(SRC) $(DEST) install -m 755 -d $(DEST)/html install -m 644 html/* $(DEST)/html diff --git a/exemple.cpp b/exemple.cpp index 46e3510..d3eedc7 100644 --- a/exemple.cpp +++ b/exemple.cpp @@ -10,7 +10,7 @@ * |CONFIG += debug | * |HEADERS += DrawingWindow.h | * |SOURCES += DrawingWindow.cpp | - * |SOURCES += exemple.cc | + * |SOURCES += exemple.cpp | * +------------------------------------------------------------+ * * 2. Créer le fichier Makefile avec la commande : diff --git a/minimal/hello.cpp b/minimal/hello.cpp new file mode 100644 index 0000000..8421198 --- /dev/null +++ b/minimal/hello.cpp @@ -0,0 +1,15 @@ +#include +#include + +void dessine(DrawingWindow& w) +{ + w.drawText(w.width / 2, w.height / 2, "Hello world!"); +} + +int main(int argc, char *argv[]) +{ + QApplication application(argc, argv); + DrawingWindow fenetre(dessine, 640, 480); + fenetre.show(); + return application.exec(); +} diff --git a/minimal/hello.pro b/minimal/hello.pro new file mode 100644 index 0000000..54c0b24 --- /dev/null +++ b/minimal/hello.pro @@ -0,0 +1,7 @@ +TEMPLATE = app +TARGET = hello +CONFIG += qt +CONFIG += debug +HEADERS += DrawingWindow.h +SOURCES += DrawingWindow.cpp +SOURCES += hello.cpp