00001 00002 /* 00003 * A Simple widget with a button to quit 00004 * and Pixmaps and Sound 00005 */ 00006 00007 /* 00008 * The below sequence is called a guard and guards 00009 * against multiple inclusion of header files 00010 */ 00011 #ifndef QUIET_SIMPLE_DEMO_H 00012 #define QUIET_SIMPLE_DEMO_H 00013 00014 00015 00016 00017 #include <qwidget.h> // from this class we will inherit 00018 00019 class QPushButton; // forward declaration to not include the header. This can save time when compiling 00020 00021 00022 /* 00023 * Simple inherits from QWidget 00024 * Remeber each example is based on the other 00025 */ 00026 class Simple : public QWidget { 00027 Q_OBJECT 00028 public: 00029 /* 00030 * C'tor for the Simple 00031 * make sure to always have these three when you use 00032 * the quicklaunch factory ( explained in the implementation ) 00033 */ 00034 Simple( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 ); 00035 ~Simple(); 00036 00037 /* 00038 * appName is used by the Application factory. 00039 * make sure the name matches the one of the executable 00040 */ 00041 static QString appName() { return QString::fromLatin1("simple-icon"); } 00042 00043 /* 00044 * use private slots: to mark your slots as such 00045 * A slot can also be called as a normal method 00046 */ 00047 private slots: 00048 void slotQuit(); 00049 00050 private: 00051 /* my variable */ 00052 QPushButton* m_button; 00053 }; 00054 00055 00056 00057 00058 #endif
1.4.2