-rw-r--r-- | examples/simple-main/simple.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/simple-main/simple.cpp b/examples/simple-main/simple.cpp index 8de911f..cf00cc6 100644 --- a/examples/simple-main/simple.cpp +++ b/examples/simple-main/simple.cpp | |||
@@ -1,58 +1,59 @@ | |||
1 | #include <qaction.h> // action | 1 | #include <qaction.h> // action |
2 | #include <qmenubar.h> // menubar | 2 | #include <qmenubar.h> // menubar |
3 | #include <qtoolbar.h> // toolbar | 3 | #include <qtoolbar.h> // toolbar |
4 | #include <qlabel.h> // a label | 4 | #include <qlabel.h> // a label |
5 | #include <qpushbutton.h> // the header file for the QPushButton | 5 | #include <qpushbutton.h> // the header file for the QPushButton |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | 7 | ||
8 | #include <qpe/qpeapplication.h> // the QPEApplication | 8 | #include <qpe/qpeapplication.h> // the QPEApplication |
9 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
10 | 10 | ||
11 | #include <opie/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching | 11 | #include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching |
12 | 12 | ||
13 | #include "simple.h" | 13 | #include "simple.h" |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * implementation of simple | 16 | * implementation of simple |
17 | */ | 17 | */ |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * The factory is used for quicklaunching | 20 | * The factory is used for quicklaunching |
21 | * It needs a constructor ( c'tor ) with at least QWidget, const char* and WFlags as parameter and a static QString appName() matching the TARGET of the .pro | 21 | * It needs a constructor ( c'tor ) with at least QWidget, const char* and WFlags as parameter and a static QString appName() matching the TARGET of the .pro |
22 | * | 22 | * |
23 | * Depending on the global quick launch setting this will create | 23 | * Depending on the global quick launch setting this will create |
24 | * either a main method or one for our component plugin system | 24 | * either a main method or one for our component plugin system |
25 | */ | 25 | */ |
26 | 26 | ||
27 | using namespace Opie::Core; | ||
27 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) | 28 | OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) |
28 | 29 | ||
29 | MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl ) | 30 | MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl ) |
30 | : QMainWindow( parent, name, fl ) { | 31 | : QMainWindow( parent, name, fl ) { |
31 | setCaption(tr("My MainWindow") ); | 32 | setCaption(tr("My MainWindow") ); |
32 | setIcon( Resource::loadPixmap("new") ); | 33 | setIcon( Resource::loadPixmap("new") ); |
33 | /* | 34 | /* |
34 | * out mainwindow should have a menubar | 35 | * out mainwindow should have a menubar |
35 | * a toolbar, a mainwidget and use Resource | 36 | * a toolbar, a mainwidget and use Resource |
36 | * to get the IconSets | 37 | * to get the IconSets |
37 | */ | 38 | */ |
38 | /* | 39 | /* |
39 | * we initialize the GUI in a different methid | 40 | * we initialize the GUI in a different methid |
40 | */ | 41 | */ |
41 | initUI(); | 42 | initUI(); |
42 | 43 | ||
43 | Simple *simple = new Simple( this ); | 44 | Simple *simple = new Simple( this ); |
44 | setCentralWidget( simple ); | 45 | setCentralWidget( simple ); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * If you use signal and slots do not include the parameter | 48 | * If you use signal and slots do not include the parameter |
48 | * names inside | 49 | * names inside |
49 | * so SIGNAL(fooBar(int) ) and NOT SIGNAL(fooBar(int foo) ) | 50 | * so SIGNAL(fooBar(int) ) and NOT SIGNAL(fooBar(int foo) ) |
50 | */ | 51 | */ |
51 | /* | 52 | /* |
52 | * We connect the activation of our QAction | 53 | * We connect the activation of our QAction |
53 | * to the slot connected to the firebutton | 54 | * to the slot connected to the firebutton |
54 | * We could also connect the signal to the clicked | 55 | * We could also connect the signal to the clicked |
55 | * signal of the button | 56 | * signal of the button |
56 | */ | 57 | */ |
57 | connect(m_fire, SIGNAL(activated() ), | 58 | connect(m_fire, SIGNAL(activated() ), |
58 | simple, SLOT(slotFire() ) ); | 59 | simple, SLOT(slotFire() ) ); |