Diffstat (limited to 'examples/simple-icon/simple.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | examples/simple-icon/simple.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/simple-icon/simple.cpp b/examples/simple-icon/simple.cpp index fec1823..2c98ec0 100644 --- a/examples/simple-icon/simple.cpp +++ b/examples/simple-icon/simple.cpp | |||
@@ -1,22 +1,21 @@ | |||
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 | #include <qpe/resource.h> // for loading icon | ||
7 | #include <qpe/sound.h> // for playing a sound | 6 | #include <qpe/sound.h> // for playing a sound |
8 | 7 | ||
9 | #include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching | 8 | #include <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching |
10 | 9 | #include <opie2/oresource.h> // for loading icon | |
11 | #include "simple.h" | 10 | #include "simple.h" |
12 | 11 | ||
13 | /* | 12 | /* |
14 | * implementation of simple | 13 | * implementation of simple |
15 | */ | 14 | */ |
16 | 15 | ||
17 | /* | 16 | /* |
18 | * The factory is used for quicklaunching | 17 | * The factory is used for quicklaunching |
19 | * 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 | * 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 |
20 | * | 19 | * |
21 | * Depending on the global quick launch setting this will create | 20 | * Depending on the global quick launch setting this will create |
22 | * either a main method or one for our component plugin system | 21 | * either a main method or one for our component plugin system |
@@ -44,25 +43,25 @@ Simple::Simple( QWidget* parent, const char* name, WFlags fl ) | |||
44 | 43 | ||
45 | /* | 44 | /* |
46 | * creates a label | 45 | * creates a label |
47 | * The first parameter is this widget so the Label is a child | 46 | * The first parameter is this widget so the Label is a child |
48 | * of us and will be deleted when we're deleted. | 47 | * of us and will be deleted when we're deleted. |
49 | */ | 48 | */ |
50 | QLabel *lbl = new QLabel( this, "a name for the label" ); | 49 | QLabel *lbl = new QLabel( this, "a name for the label" ); |
51 | /* | 50 | /* |
52 | * Resource will search hard for a Pixmap in $OPIEDIR/pics | 51 | * Resource will search hard for a Pixmap in $OPIEDIR/pics |
53 | * to find 'logo/opielogo' You need to pass the subdir | 52 | * to find 'logo/opielogo' You need to pass the subdir |
54 | * but not the ending | 53 | * but not the ending |
55 | */ | 54 | */ |
56 | lbl->setPixmap( Resource::loadPixmap("logo/opielogo") ); | 55 | lbl->setPixmap( Opie::Core::OResource::loadPixmap("logo/opielogo", Opie::Core::OResource::SmallIcon) ); |
57 | layout->addWidget( lbl ); | 56 | layout->addWidget( lbl ); |
58 | 57 | ||
59 | 58 | ||
60 | /* creates a button as child of this widget */ | 59 | /* creates a button as child of this widget */ |
61 | m_button = new QPushButton(this); | 60 | m_button = new QPushButton(this); |
62 | /* | 61 | /* |
63 | * another way to call tr. The first parameter is the string | 62 | * another way to call tr. The first parameter is the string |
64 | * to translate and the second a hint to the translator | 63 | * to translate and the second a hint to the translator |
65 | */ | 64 | */ |
66 | m_button->setText( tr("Fire", "translatable fire string" ) ); | 65 | m_button->setText( tr("Fire", "translatable fire string" ) ); |
67 | layout->addWidget( m_button ); | 66 | layout->addWidget( m_button ); |
68 | 67 | ||