summaryrefslogtreecommitdiff
path: root/example
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /example
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'example') (more/less context) (show whitespace changes)
-rw-r--r--example/Example.pngbin0 -> 1262 bytes
-rw-r--r--example/README2
-rw-r--r--example/example.control11
-rw-r--r--example/example.cpp28
-rw-r--r--example/example.desktop6
-rw-r--r--example/example.h17
-rw-r--r--example/example.pro10
-rw-r--r--example/examplebase.ui55
-rw-r--r--example/main.cpp12
9 files changed, 141 insertions, 0 deletions
diff --git a/example/Example.png b/example/Example.png
new file mode 100644
index 0000000..f63d0bc
--- a/dev/null
+++ b/example/Example.png
Binary files differ
diff --git a/example/README b/example/README
new file mode 100644
index 0000000..98c2c51
--- a/dev/null
+++ b/example/README
@@ -0,0 +1,2 @@
+See /opt/Qtopia/doc/html/qtopia/index.html for help.
+See doc.trolltech.com for more recent documentation updates.
diff --git a/example/example.control b/example/example.control
new file mode 100644
index 0000000..b0f267a
--- a/dev/null
+++ b/example/example.control
@@ -0,0 +1,11 @@
+Files: bin/example apps/Applications/example.desktop pics/Example.png
+Priority: optional
+Section: qpe/applications
+Maintainer: Warwick Allison <warwick@trolltech.com>
+Architecture: arm
+Version: 1.0.0
+Depends: qpe-base ($QPE_VERSION)
+License: Public Domain
+Description: Example program
+ An example program for the Qtopia environment.
+ Does nothing interesting.
diff --git a/example/example.cpp b/example/example.cpp
new file mode 100644
index 0000000..1e0bbe9
--- a/dev/null
+++ b/example/example.cpp
@@ -0,0 +1,28 @@
+#include "example.h"
+#include <qpushbutton.h>
+
+/*
+ * Constructs a Example which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+Example::Example( QWidget* parent, const char* name, WFlags fl )
+ : ExampleBase( parent, name, fl )
+{
+ connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+Example::~Example()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * A simple slot... not very interesting.
+ */
+void Example::goodBye()
+{
+ close();
+}
diff --git a/example/example.desktop b/example/example.desktop
new file mode 100644
index 0000000..f1e6f06
--- a/dev/null
+++ b/example/example.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Comment=An Example Program
+Exec=example
+Icon=Example
+Type=Application
+Name=Example
diff --git a/example/example.h b/example/example.h
new file mode 100644
index 0000000..24c58c0
--- a/dev/null
+++ b/example/example.h
@@ -0,0 +1,17 @@
+#ifndef EXAMPLE_H
+#define EXAMPLE_H
+#include "examplebase.h"
+
+class Example : public ExampleBase
+{
+ Q_OBJECT
+
+public:
+ Example( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~Example();
+
+private slots:
+ void goodBye();
+};
+
+#endif // EXAMPLE_H
diff --git a/example/example.pro b/example/example.pro
new file mode 100644
index 0000000..2d89311
--- a/dev/null
+++ b/example/example.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+#CONFIG = qt warn_on debug
+CONFIG = qt warn_on release
+HEADERS = example.h
+SOURCES = main.cpp example.cpp
+INCLUDEPATH += $(QPEDIR)/include
+DEPENDPATH += $(QPEDIR)/include
+LIBS += -lqpe
+INTERFACES = examplebase.ui
+TARGET = example
diff --git a/example/examplebase.ui b/example/examplebase.ui
new file mode 100644
index 0000000..b47d20c
--- a/dev/null
+++ b/example/examplebase.ui
@@ -0,0 +1,55 @@
+<!DOCTYPE UI><UI>
+<class>ExampleBase</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ExampleBase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>196</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Example</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&lt;p&gt;This is just an &lt;i&gt;example&lt;/i&gt;. It doesn't do anything interesting at all.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>quit</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Quit</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+</UI>
diff --git a/example/main.cpp b/example/main.cpp
new file mode 100644
index 0000000..b705c44
--- a/dev/null
+++ b/example/main.cpp
@@ -0,0 +1,12 @@
+#include "example.h"
+#include <qpe/qpeapplication.h>
+
+int main( int argc, char ** argv )
+{
+ QPEApplication a( argc, argv );
+
+ Example mw;
+ a.showMainWidget( &mw );
+
+ return a.exec();
+}