summaryrefslogtreecommitdiff
path: root/examples/simple-main/simple.cpp
Side-by-side diff
Diffstat (limited to 'examples/simple-main/simple.cpp') (more/less context) (show whitespace changes)
-rw-r--r--examples/simple-main/simple.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/simple-main/simple.cpp b/examples/simple-main/simple.cpp
index cf00cc6..b227a1f 100644
--- a/examples/simple-main/simple.cpp
+++ b/examples/simple-main/simple.cpp
@@ -1,57 +1,57 @@
#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 <opie2/oapplicationfactory.h> // a template + macro to save the main method and allow quick launching
+#include <opie2/oresource.h>
#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") );
+ setIcon( Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon) );
/*
* 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
*/
@@ -107,59 +107,59 @@ void MainWindow::initUI() {
/*
*We don't want the static toolbar but share it with the
* toolbar on small screens
*/
QToolBar *menuBarHolder = new QToolBar( this );
/* we allow the menubarholder to become bigger than
* the screen width and to offer a > for the additional items
*/
menuBarHolder->setHorizontalStretchable( true );
QMenuBar *mb = new QMenuBar( menuBarHolder );
QToolBar *tb = new QToolBar( this );
QPopupMenu *fileMenu = new QPopupMenu( this );
/*
* we create our first action with the Text Quit
* a IconSet, no menu name, no acceleration ( keyboard shortcut ),
* with parent this, and name "quit_action"
*/
/*
* Note if you want a picture out of the inline directory
* you musn't prefix inline/ inline means these pics are built in
* into libqpe so the name without ending and directory is enough
*/
- QAction *a = new QAction( tr("Quit"), Resource::loadIconSet("quit_icon"),
+ QAction *a = new QAction( tr("Quit"), Opie::Core::OResource::loadPixmap("quit_icon", Opie::Core::OResource::SmallIcon),
QString::null, 0, this, "quit_action" );
/*
* Connect quit to the QApplication quit slot
*/
connect(a, SIGNAL(activated() ),
qApp, SLOT(quit() ) );
a->addTo( fileMenu );
a = new QAction(tr("Fire"),
- Resource::loadIconSet("new"),
+ Opie::Core::OResource::loadPixmap("new", Opie::Core::OResource::SmallIcon),
QString::null, 0, this, "fire_button");
/* see the power? */
a->addTo( fileMenu );
a->addTo( tb );
m_fire = a;
mb->insertItem(tr("File"), fileMenu );
}
Simple::Simple( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl ) {
/*
* sets the caption of this toplevel widget
* put all translatable string into tr()
*/
setCaption(tr("My Simple Application") );
/*
* A simple vertical layout
* either call layout->setAutoAdd( true )