author | zecke <zecke> | 2003-08-30 20:23:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-30 20:23:05 (UTC) |
commit | 4c3a1de5289631db05b86a07092f0a334608dcf6 (patch) (unidiff) | |
tree | 90caf9b05312013006dad0af7f039ed1c595842d /examples/main-tab/simple.h | |
parent | cc1e68e0b6e0677e0523382daeb12d60ba0b67c9 (diff) | |
download | opie-4c3a1de5289631db05b86a07092f0a334608dcf6.zip opie-4c3a1de5289631db05b86a07092f0a334608dcf6.tar.gz opie-4c3a1de5289631db05b86a07092f0a334608dcf6.tar.bz2 |
Add four examples
#1 simple widget + OApplicationFactory + qmake usage explained
#2 simple icons + usage of Resource and playing of sounds
#3 simple main + Toolbar + MenuBar IconSets and QActions explained
#4 main tab + Usage of OTabWidget and QSignals with parameters disconnect and connect
TODO
#5 PIM loading and viewing
#6 PIM qcop + usage of QCOP
BuildSystem integration
-rw-r--r-- | examples/main-tab/simple.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/examples/main-tab/simple.h b/examples/main-tab/simple.h new file mode 100644 index 0000000..e0e43c0 --- a/dev/null +++ b/examples/main-tab/simple.h | |||
@@ -0,0 +1,87 @@ | |||
1 | |||
2 | /* | ||
3 | * A Simple widget with a button to quit | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * The below sequence is called a guard and guards | ||
9 | * against multiple inclusion of header files | ||
10 | * NOTE: you need to use unique names among the header files | ||
11 | */ | ||
12 | #ifndef QUIET_SIMPLE_DEMO_H | ||
13 | #define QUIET_SIMPLE_DEMO_H | ||
14 | |||
15 | |||
16 | |||
17 | |||
18 | #include <qmainwindow.h> // from this class we will inherit | ||
19 | |||
20 | |||
21 | class QPushButton; // forward declaration to not include the header. This can save time when compiling | ||
22 | class QAction; | ||
23 | |||
24 | /* | ||
25 | * A mainwindow is a special QWidget it helps layouting | ||
26 | * toolbar, statusbar, menubar. Got dockable areas | ||
27 | * So in one sentence it is a MainWindow :) | ||
28 | */ | ||
29 | class MainWindow : public QMainWindow { | ||
30 | Q_OBJECT | ||
31 | public: | ||
32 | static QString appName() { return QString::fromLatin1("main-tab"); } | ||
33 | MainWindow( QWidget* parent, const char* name, WFlags fl ); | ||
34 | ~MainWindow(); | ||
35 | |||
36 | public slots: | ||
37 | void setDocument( const QString& ); | ||
38 | private slots: | ||
39 | void slotCurrentChanged( QWidget* wid ); | ||
40 | |||
41 | private: | ||
42 | void initUI(); | ||
43 | QAction *m_fire; | ||
44 | QWidget* m_oldCurrent; | ||
45 | }; | ||
46 | |||
47 | |||
48 | /* | ||
49 | * We will just reuse the two simple widgets for now | ||
50 | */ | ||
51 | class Simple1 : public QWidget { | ||
52 | |||
53 | Q_OBJECT | ||
54 | public: | ||
55 | |||
56 | Simple1( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 ); | ||
57 | ~Simple1(); | ||
58 | |||
59 | |||
60 | public slots: | ||
61 | void slotFire(); | ||
62 | |||
63 | private: | ||
64 | /* my variable */ | ||
65 | QPushButton* m_button; | ||
66 | }; | ||
67 | |||
68 | class Simple2 : public QWidget { | ||
69 | Q_OBJECT | ||
70 | public: | ||
71 | |||
72 | Simple2( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 ); | ||
73 | ~Simple2(); | ||
74 | |||
75 | |||
76 | |||
77 | public slots: | ||
78 | void slotFire(); | ||
79 | |||
80 | private: | ||
81 | /* my variable */ | ||
82 | QPushButton* m_button; | ||
83 | }; | ||
84 | |||
85 | |||
86 | |||
87 | #endif | ||