-rw-r--r-- | examples/simple-icon/simple.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/examples/simple-icon/simple.h b/examples/simple-icon/simple.h new file mode 100644 index 0000000..00965cd --- a/dev/null +++ b/examples/simple-icon/simple.h | |||
@@ -0,0 +1,58 @@ | |||
1 | |||
2 | /* | ||
3 | * A Simple widget with a button to quit | ||
4 | * and Pixmaps and Sound | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * The below sequence is called a guard and guards | ||
9 | * against multiple inclusion of header files | ||
10 | */ | ||
11 | #ifndef QUIET_SIMPLE_DEMO_H | ||
12 | #define QUIET_SIMPLE_DEMO_H | ||
13 | |||
14 | |||
15 | |||
16 | |||
17 | #include <qwidget.h> // from this class we will inherit | ||
18 | |||
19 | class QPushButton; // forward declaration to not include the header. This can save time when compiling | ||
20 | |||
21 | |||
22 | /* | ||
23 | * Simple inherits from QWidget | ||
24 | * Remeber each example is based on the other | ||
25 | */ | ||
26 | class Simple : public QWidget { | ||
27 | Q_OBJECT | ||
28 | public: | ||
29 | /* | ||
30 | * C'tor for the Simple | ||
31 | * make sure to always have these three when you use | ||
32 | * the quicklaunch factory ( explained in the implementation ) | ||
33 | */ | ||
34 | Simple( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 ); | ||
35 | ~Simple(); | ||
36 | |||
37 | /* | ||
38 | * appName is used by the Application factory. | ||
39 | * make sure the name matches the one of the executable | ||
40 | */ | ||
41 | static QString appName() { return QString::fromLatin1("simple-icon"); } | ||
42 | |||
43 | /* | ||
44 | * use private slots: to mark your slots as such | ||
45 | * A slot can also be called as a normal method | ||
46 | */ | ||
47 | private slots: | ||
48 | void slotQuit(); | ||
49 | |||
50 | private: | ||
51 | /* my variable */ | ||
52 | QPushButton* m_button; | ||
53 | }; | ||
54 | |||
55 | |||
56 | |||
57 | |||
58 | #endif | ||