author | zecke <zecke> | 2004-03-14 20:08:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 20:08:59 (UTC) |
commit | 0d79c003839718ae70b3b997162044abd5c26bf6 (patch) (side-by-side diff) | |
tree | 19708b041da3a09df8f3b571cd634a846f4ad6d7 /examples/simple-main | |
parent | 05c8d999941989a97a581fb5822437034ec10fd7 (diff) | |
download | opie-0d79c003839718ae70b3b997162044abd5c26bf6.zip opie-0d79c003839718ae70b3b997162044abd5c26bf6.tar.gz opie-0d79c003839718ae70b3b997162044abd5c26bf6.tar.bz2 |
Update the Examples
-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,74 +1,75 @@ #include <qaction.h> // action #include <qmenubar.h> // menubar #include <qtoolbar.h> // toolbar #include <qlabel.h> // a label #include <qpushbutton.h> // the header file for the QPushButton #include <qlayout.h> #include <qpe/qpeapplication.h> // the QPEApplication #include <qpe/resource.h> -#include <opie/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching +#include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching #include "simple.h" /* * implementation of simple */ /* * The factory is used for quicklaunching * 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 * * Depending on the global quick launch setting this will create * either a main method or one for our component plugin system */ +using namespace Opie::Core; OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) MainWindow::MainWindow(QWidget *parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { setCaption(tr("My MainWindow") ); setIcon( Resource::loadPixmap("new") ); /* * out mainwindow should have a menubar * a toolbar, a mainwidget and use Resource * to get the IconSets */ /* * we initialize the GUI in a different methid */ initUI(); Simple *simple = new Simple( this ); setCentralWidget( simple ); /* * If you use signal and slots do not include the parameter * names inside * so SIGNAL(fooBar(int) ) and NOT SIGNAL(fooBar(int foo) ) */ /* * We connect the activation of our QAction * to the slot connected to the firebutton * We could also connect the signal to the clicked * signal of the button */ connect(m_fire, SIGNAL(activated() ), simple, SLOT(slotFire() ) ); } MainWindow::~MainWindow() { // again nothing to delete because Qt takes care } /* * set Document is a special function used by Document * centric applications. * In example if Opie receives a Todo via IrDa it uses * setDocument via QCOP the IPC system to load the card * Or If you decide to open a file in filemanager with textedit * setDocument is called via IPC in textedit. * Also any call to QPE/Application/xyz and xyz is currently not running * leads to the start of xyz and delivering of the QCOP call * But more on QCOP in the next application |