Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

simple.h

Go to the documentation of this file.
00001 
00002 /*
00003  * A Simple widget with a button to quit
00004  *
00005  */
00006 
00007 /*
00008  * The below sequence is called a guard and guards
00009  * against multiple inclusion of header files
00010  * NOTE: you need to use unique names among the header files
00011  */
00012 #ifndef QUIET_SIMPLE_DEMO_H
00013 #define QUIET_SIMPLE_DEMO_H
00014 
00015 
00016 
00017 
00018 #include <qmainwindow.h>  // from this class we will inherit
00019 
00020 
00021 class QPushButton; // forward declaration to not include the header. This can save time when compiling
00022 class QAction;
00023 
00024 /*
00025  * A mainwindow is a special QWidget it helps layouting
00026  * toolbar, statusbar, menubar. Got dockable areas
00027  * So in one sentence it is a MainWindow :)
00028  */
00029 class MainWindow : public QMainWindow {
00030     Q_OBJECT
00031 public:
00032     static QString appName() { return QString::fromLatin1("simple-main"); }
00033     MainWindow( QWidget* parent, const char* name,  WFlags fl );
00034     ~MainWindow();
00035 
00036 public slots:
00037     void setDocument( const QString& );
00038 
00039 private:
00040     void initUI();
00041     QAction *m_fire;
00042 };
00043 
00044 
00045 /*
00046  * Simple inherits from QWidget
00047  */
00048 class Simple : public QWidget {
00049     /*
00050      * Q_OBJECT must always be the first thing you include
00051      * This is a macro and is responsible for the concepts of
00052      * dynamic signal and slots and other MetaObjects as
00053      * superClass(), inherits(), isA()...
00054      * If you use multiple inheritance include the class derived
00055      * from QObject first
00056      */
00057     Q_OBJECT
00058 public:
00059     /*
00060      * C'tor for the Simple
00061      * make sure to always have these three when you use
00062      * the quicklaunch factory ( explained in the implementation )
00063      */
00064     Simple( QWidget* parent = 0, const char * name = 0,  WFlags fl = 0 );
00065     ~Simple();
00066 
00067     /*
00068      * We now make it public because our mainwindow wants to call it
00069      */
00070 public slots:
00071     void slotFire();
00072 
00073 private:
00074     /* my variable */
00075     QPushButton* m_button;
00076 };
00077 
00078 
00079 
00080 
00081 #endif

Generated on Sat Nov 5 16:15:59 2005 for OPIE by  doxygen 1.4.2