summaryrefslogtreecommitdiff
path: root/examples/simple
authorzecke <zecke>2004-03-14 20:08:59 (UTC)
committer zecke <zecke>2004-03-14 20:08:59 (UTC)
commit0d79c003839718ae70b3b997162044abd5c26bf6 (patch) (unidiff)
tree19708b041da3a09df8f3b571cd634a846f4ad6d7 /examples/simple
parent05c8d999941989a97a581fb5822437034ec10fd7 (diff)
downloadopie-0d79c003839718ae70b3b997162044abd5c26bf6.zip
opie-0d79c003839718ae70b3b997162044abd5c26bf6.tar.gz
opie-0d79c003839718ae70b3b997162044abd5c26bf6.tar.bz2
Update the Examples
Diffstat (limited to 'examples/simple') (more/less context) (show whitespace changes)
-rw-r--r--examples/simple/simple.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/simple/simple.cpp b/examples/simple/simple.cpp
index a0bc308..faf13c9 100644
--- a/examples/simple/simple.cpp
+++ b/examples/simple/simple.cpp
@@ -1,46 +1,48 @@
1#include <qlabel.h> // a label 1#include <qlabel.h> // a label
2#include <qpushbutton.h> // the header file for the QPushButton 2#include <qpushbutton.h> // the header file for the QPushButton
3#include <qlayout.h> 3#include <qlayout.h>
4 4
5#include <qpe/qpeapplication.h> // the QPEApplication 5#include <qpe/qpeapplication.h> // the QPEApplication
6 6
7#include <opie/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching 7#include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching
8 8
9#include "simple.h" 9#include "simple.h"
10 10
11/* 11/*
12 * implementation of simple 12 * implementation of simple
13 */ 13 */
14 14
15/* 15/*
16 * The factory is used for quicklaunching 16 * The factory is used for quicklaunching
17 * 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 17 * 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
18 * 18 *
19 * Depending on the global quick launch setting this will create 19 * Depending on the global quick launch setting this will create
20 * either a main method or one for our component plugin system 20 * either a main method or one for our component plugin system
21 */ 21 */
22 22
23/* The OApplicationFactory is in Opie::Core */
24using namespace Opie::Core;
23OPIE_EXPORT_APP( OApplicationFactory<Simple> ) 25OPIE_EXPORT_APP( OApplicationFactory<Simple> )
24 26
25Simple::Simple( QWidget* parent, const char* name, WFlags fl ) 27Simple::Simple( QWidget* parent, const char* name, WFlags fl )
26 : QWidget( parent, name, fl ) { 28 : QWidget( parent, name, fl ) {
27 29
28 /* 30 /*
29 * sets the caption of this toplevel widget 31 * sets the caption of this toplevel widget
30 * put all translatable string into tr() 32 * put all translatable string into tr()
31 */ 33 */
32 setCaption(tr("My Simple Application") ); 34 setCaption(tr("My Simple Application") );
33 35
34 /* 36 /*
35 * A simple vertical layout 37 * A simple vertical layout
36 * either call layout->setAutoAdd( true ) 38 * either call layout->setAutoAdd( true )
37 * or use layout->addWidget( wid ) to add widgets 39 * or use layout->addWidget( wid ) to add widgets
38 */ 40 */
39 QVBoxLayout *layout = new QVBoxLayout( this ); 41 QVBoxLayout *layout = new QVBoxLayout( this );
40 layout->setSpacing( 8 ); 42 layout->setSpacing( 8 );
41 layout->setMargin( 11 ); 43 layout->setMargin( 11 );
42 44
43 /* 45 /*
44 * creates a label 46 * creates a label
45 * The first parameter is this widget so the Label is a child 47 * The first parameter is this widget so the Label is a child
46 * of us and will be deleted when we're deleted. 48 * of us and will be deleted when we're deleted.