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("main-tab"); }
00033     MainWindow( QWidget* parent, const char* name,  WFlags fl );
00034     ~MainWindow();
00035 
00036 public slots:
00037     void setDocument( const QString& );
00038 private slots:
00039     void slotCurrentChanged( QWidget* wid );
00040 
00041 private:
00042     void initUI();
00043     QAction *m_fire;
00044     QWidget* m_oldCurrent;
00045 };
00046 
00047 
00048 /*
00049  * We will just reuse the two simple widgets for now
00050  */
00051 class Simple1 : public QWidget {
00052 
00053     Q_OBJECT
00054 public:
00055 
00056     Simple1( QWidget* parent = 0, const char * name = 0,  WFlags fl = 0 );
00057     ~Simple1();
00058 
00059 
00060 public slots:
00061     void slotFire();
00062 
00063 private:
00064     /* my variable */
00065     QPushButton* m_button;
00066 };
00067 
00068 class Simple2 : public QWidget {
00069     Q_OBJECT
00070 public:
00071 
00072     Simple2( QWidget* parent = 0, const char * name = 0,  WFlags fl = 0 );
00073     ~Simple2();
00074 
00075 
00076 
00077 public slots:
00078     void slotFire();
00079 
00080 private:
00081     /* my variable */
00082     QPushButton* m_button;
00083 };
00084 
00085 
00086 
00087 #endif

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