Das Hauptprogramm fällt dank unserer strukturierten Programmierung sehr kurz aus:
#include "MainWindow.h" #include <QApplication> //! Main function of the program. /*! * Creates the main window, displays it and starts the event loop. * \param argc Number of command line parameters. * \param argv Command line parameters. */ int main( int argc, char *argv[] ) { QApplication app( argc, argv ); MainWindow mw; mw.show(); return app.exec(); }
Es wird die von Qt benötigte QApplication
-Instanz erstellt. Danach wird das Hauptfesnter unseres Editors erstellt, angezeigt und die Event-Schleife gestartet.
Das wars, unser Editor ist fertig