summaryrefslogtreecommitdiff
path: root/examples/main-tab/simple.h
authorzecke <zecke>2003-08-30 20:23:05 (UTC)
committer zecke <zecke>2003-08-30 20:23:05 (UTC)
commit4c3a1de5289631db05b86a07092f0a334608dcf6 (patch) (side-by-side diff)
tree90caf9b05312013006dad0af7f039ed1c595842d /examples/main-tab/simple.h
parentcc1e68e0b6e0677e0523382daeb12d60ba0b67c9 (diff)
downloadopie-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
Diffstat (limited to 'examples/main-tab/simple.h') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/main-tab/simple.h87
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 @@
+
+/*
+ * A Simple widget with a button to quit
+ *
+ */
+
+/*
+ * The below sequence is called a guard and guards
+ * against multiple inclusion of header files
+ * NOTE: you need to use unique names among the header files
+ */
+#ifndef QUIET_SIMPLE_DEMO_H
+#define QUIET_SIMPLE_DEMO_H
+
+
+
+
+#include <qmainwindow.h> // from this class we will inherit
+
+
+class QPushButton; // forward declaration to not include the header. This can save time when compiling
+class QAction;
+
+/*
+ * A mainwindow is a special QWidget it helps layouting
+ * toolbar, statusbar, menubar. Got dockable areas
+ * So in one sentence it is a MainWindow :)
+ */
+class MainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ static QString appName() { return QString::fromLatin1("main-tab"); }
+ MainWindow( QWidget* parent, const char* name, WFlags fl );
+ ~MainWindow();
+
+public slots:
+ void setDocument( const QString& );
+private slots:
+ void slotCurrentChanged( QWidget* wid );
+
+private:
+ void initUI();
+ QAction *m_fire;
+ QWidget* m_oldCurrent;
+};
+
+
+/*
+ * We will just reuse the two simple widgets for now
+ */
+class Simple1 : public QWidget {
+
+ Q_OBJECT
+public:
+
+ Simple1( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 );
+ ~Simple1();
+
+
+public slots:
+ void slotFire();
+
+private:
+ /* my variable */
+ QPushButton* m_button;
+};
+
+class Simple2 : public QWidget {
+ Q_OBJECT
+public:
+
+ Simple2( QWidget* parent = 0, const char * name = 0, WFlags fl = 0 );
+ ~Simple2();
+
+
+
+public slots:
+ void slotFire();
+
+private:
+ /* my variable */
+ QPushButton* m_button;
+};
+
+
+
+#endif