summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-05-25 01:11:52 +1000
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-25 01:11:52 +1000
commit6bd691dc5402f22840a3354b08cb6bdc99b01006 (patch)
tree6ef3847a93f501d52fcb01927c6c9f36a94570e5 /examples/statemachine
parente60f05201f5bc412ec8c02625bcbbca5ba50812c (diff)
parent4d10065c54f9b277f44ed042f4e18858dafdd1df (diff)
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging: (21 commits) Fixed line endings. Update licenseheader text in source files for qtbase Qt module New configure.exe binary Add -qpa option on Windows Use qglobal.h's VERSION number instead of hardcoded current version More examples adjusted to Symbian and Maemo5. (cherry picked from commit a97b9620a584c9b1a2e006873183526b3d7e001e) Doc: Added some details to the accessibility events API documentation. Doc: Fixed qdoc warnings. Doc: Fixed qdoc warnings. Doc: Made an additional change for clarity. Doc: Noted that the example will not work as expected with a mouse. Doc: Fixed qdoc warnings. Doc: Applying a pending change from previous merges. Doc: Fixed qdoc warning. Doc: Fixed qdoc warnings. Doc: Applied pending fixes to API documentation. Doc: Various fixes to documentation, some based on changes in master. Doc: Added missing project and desktop files. Doc: Documented the value returned when no field can be found. Squashed commit of changes from the 4.8-temp branch. ...
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.desktop11
-rw-r--r--examples/statemachine/eventtransitions/eventtransitions.pro5
-rw-r--r--examples/statemachine/eventtransitions/main.cpp11
-rw-r--r--examples/statemachine/factorial/factorial.desktop11
-rw-r--r--examples/statemachine/factorial/factorial.pro5
-rw-r--r--examples/statemachine/pingpong/pingpong.desktop11
-rw-r--r--examples/statemachine/pingpong/pingpong.pro5
-rw-r--r--examples/statemachine/rogue/main.cpp4
-rw-r--r--examples/statemachine/rogue/movementtransition.h7
-rw-r--r--examples/statemachine/rogue/rogue.desktop11
-rw-r--r--examples/statemachine/rogue/rogue.pro3
-rw-r--r--examples/statemachine/rogue/window.cpp12
-rw-r--r--examples/statemachine/rogue/window.h5
-rw-r--r--examples/statemachine/trafficlight/main.cpp9
-rw-r--r--examples/statemachine/trafficlight/trafficlight.desktop11
-rw-r--r--examples/statemachine/trafficlight/trafficlight.pro4
-rw-r--r--examples/statemachine/twowaybutton/main.cpp6
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.desktop11
-rw-r--r--examples/statemachine/twowaybutton/twowaybutton.pro4
19 files changed, 141 insertions, 5 deletions
diff --git a/examples/statemachine/eventtransitions/eventtransitions.desktop b/examples/statemachine/eventtransitions/eventtransitions.desktop
new file mode 100644
index 0000000000..c1bceb2240
--- /dev/null
+++ b/examples/statemachine/eventtransitions/eventtransitions.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Event Transitions
+Exec=/opt/usr/bin/eventtransitions
+Icon=eventtransitions
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/eventtransitions/eventtransitions.pro b/examples/statemachine/eventtransitions/eventtransitions.pro
index 646c90a07d..8b77bb25a1 100644
--- a/examples/statemachine/eventtransitions/eventtransitions.pro
+++ b/examples/statemachine/eventtransitions/eventtransitions.pro
@@ -5,3 +5,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS eventtransitions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/eventtransitions
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/statemachine/eventtransitions/main.cpp b/examples/statemachine/eventtransitions/main.cpp
index 5391057992..5c0eb8218b 100644
--- a/examples/statemachine/eventtransitions/main.cpp
+++ b/examples/statemachine/eventtransitions/main.cpp
@@ -48,7 +48,12 @@ public:
: QWidget(parent)
{
QPushButton *button = new QPushButton(this);
- button->setGeometry(QRect(100, 100, 100, 100));
+ button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(button);
+ layout->setContentsMargins(80, 80, 80, 80);
+ setLayout(layout);
//! [0]
//! [1]
@@ -103,7 +108,11 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
Window window;
window.resize(300, 300);
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/factorial/factorial.desktop b/examples/statemachine/factorial/factorial.desktop
new file mode 100644
index 0000000000..41b27227f9
--- /dev/null
+++ b/examples/statemachine/factorial/factorial.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Factorial States
+Exec=/opt/usr/bin/factorial
+Icon=factorial
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/factorial/factorial.pro b/examples/statemachine/factorial/factorial.pro
index 4291d43306..012e175e3b 100644
--- a/examples/statemachine/factorial/factorial.pro
+++ b/examples/statemachine/factorial/factorial.pro
@@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS factorial.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/factorial
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/statemachine/pingpong/pingpong.desktop b/examples/statemachine/pingpong/pingpong.desktop
new file mode 100644
index 0000000000..79646a2cc8
--- /dev/null
+++ b/examples/statemachine/pingpong/pingpong.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Ping Pong States
+Exec=/opt/usr/bin/pingpong
+Icon=pingpong
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/pingpong/pingpong.pro b/examples/statemachine/pingpong/pingpong.pro
index 9d2b17fc9e..9ee782c1de 100644
--- a/examples/statemachine/pingpong/pingpong.pro
+++ b/examples/statemachine/pingpong/pingpong.pro
@@ -9,3 +9,8 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS pingpong.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/pingpong
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
+symbian: warning(This example does not work on Symbian platform)
diff --git a/examples/statemachine/rogue/main.cpp b/examples/statemachine/rogue/main.cpp
index 71c2c69470..dc8783c67e 100644
--- a/examples/statemachine/rogue/main.cpp
+++ b/examples/statemachine/rogue/main.cpp
@@ -47,7 +47,11 @@ int main(int argv, char **args)
QApplication app(argv, args);
Window window;
+#if defined(Q_OS_SYMBIAN)
+ window.showMaximized();
+#else
window.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h
index 1153b7508d..be15e38647 100644
--- a/examples/statemachine/rogue/movementtransition.h
+++ b/examples/statemachine/rogue/movementtransition.h
@@ -68,7 +68,8 @@ protected:
int key = keyEvent->key();
return key == Qt::Key_2 || key == Qt::Key_8 || key == Qt::Key_6 ||
- key == Qt::Key_4;
+ key == Qt::Key_4 || key == Qt::Key_Down || key == Qt::Key_Up ||
+ key == Qt::Key_Right || key == Qt::Key_Left;
}
return false;
}
@@ -81,15 +82,19 @@ protected:
int key = keyEvent->key();
switch (key) {
+ case Qt::Key_Left:
case Qt::Key_4:
window->movePlayer(Window::Left);
break;
+ case Qt::Key_Up:
case Qt::Key_8:
window->movePlayer(Window::Up);
break;
+ case Qt::Key_Right:
case Qt::Key_6:
window->movePlayer(Window::Right);
break;
+ case Qt::Key_Down:
case Qt::Key_2:
window->movePlayer(Window::Down);
break;
diff --git a/examples/statemachine/rogue/rogue.desktop b/examples/statemachine/rogue/rogue.desktop
new file mode 100644
index 0000000000..71ca4b6511
--- /dev/null
+++ b/examples/statemachine/rogue/rogue.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Rogue
+Exec=/opt/usr/bin/rogue
+Icon=rogue
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/rogue/rogue.pro b/examples/statemachine/rogue/rogue.pro
index 6ab613bea9..c4fcfe9cfe 100644
--- a/examples/statemachine/rogue/rogue.pro
+++ b/examples/statemachine/rogue/rogue.pro
@@ -9,3 +9,6 @@ sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/rogue
INSTALLS += target sources
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/statemachine/rogue/window.cpp b/examples/statemachine/rogue/window.cpp
index 39f5aa65d9..f40b7a020e 100644
--- a/examples/statemachine/rogue/window.cpp
+++ b/examples/statemachine/rogue/window.cpp
@@ -52,16 +52,22 @@ Window::Window()
QFontDatabase database;
QFont font;
- if (database.families().contains("Monospace"))
- font = QFont("Monospace", 12);
+ if (database.families().contains("Monospace")) {
+ font = QFont("Monospace");
+ }
else {
foreach (QString family, database.families()) {
if (database.isFixedPitch(family)) {
- font = QFont(family, 12);
+ font = QFont(family);
break;
}
}
}
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+ font.setPointSize(5);
+#else
+ font.setPointSize(12);
+#endif
setFont(font);
//![1]
diff --git a/examples/statemachine/rogue/window.h b/examples/statemachine/rogue/window.h
index 025ec79600..bdadad463d 100644
--- a/examples/statemachine/rogue/window.h
+++ b/examples/statemachine/rogue/window.h
@@ -49,8 +49,13 @@ class QStateMachine;
class QTransition;
QT_END_NAMESPACE
+#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
+#define WIDTH 43
+#define HEIGHT 14
+#else
#define WIDTH 35
#define HEIGHT 20
+#endif
//![0]
class Window : public QWidget
diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp
index 23cd34833a..c20e05926f 100644
--- a/examples/statemachine/trafficlight/main.cpp
+++ b/examples/statemachine/trafficlight/main.cpp
@@ -88,6 +88,9 @@ public:
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
+#ifdef Q_WS_MAEMO_5
+ vbox->setContentsMargins(320, 0, 320, 0);
+#endif
m_red = new LightWidget(Qt::red);
vbox->addWidget(m_red);
m_yellow = new LightWidget(Qt::yellow);
@@ -174,8 +177,14 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
TrafficLight widget;
+#if defined(Q_OS_SYMBIAN)
+ widget.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ widget.show();
+#else
widget.resize(110, 300);
widget.show();
+#endif
return app.exec();
}
diff --git a/examples/statemachine/trafficlight/trafficlight.desktop b/examples/statemachine/trafficlight/trafficlight.desktop
new file mode 100644
index 0000000000..8a5cc1673b
--- /dev/null
+++ b/examples/statemachine/trafficlight/trafficlight.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Traffic Light
+Exec=/opt/usr/bin/trafficlight
+Icon=trafficlight
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/trafficlight/trafficlight.pro b/examples/statemachine/trafficlight/trafficlight.pro
index f6aab8d6e5..4b77bcb8e9 100644
--- a/examples/statemachine/trafficlight/trafficlight.pro
+++ b/examples/statemachine/trafficlight/trafficlight.pro
@@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS trafficlight.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/trafficlight
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+
diff --git a/examples/statemachine/twowaybutton/main.cpp b/examples/statemachine/twowaybutton/main.cpp
index 6b9ce1fe55..47343ce494 100644
--- a/examples/statemachine/twowaybutton/main.cpp
+++ b/examples/statemachine/twowaybutton/main.cpp
@@ -74,8 +74,14 @@ int main(int argc, char **argv)
//! [4]
//! [5]
+#if defined(Q_OS_SYMBIAN)
+ button.showMaximized();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+ button.show();
+#else
button.resize(100, 50);
button.show();
+#endif
return app.exec();
}
//! [5]
diff --git a/examples/statemachine/twowaybutton/twowaybutton.desktop b/examples/statemachine/twowaybutton/twowaybutton.desktop
new file mode 100644
index 0000000000..9dd0918937
--- /dev/null
+++ b/examples/statemachine/twowaybutton/twowaybutton.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Two-way Button
+Exec=/opt/usr/bin/twowaybutton
+Icon=twowaybutton
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/statemachine/twowaybutton/twowaybutton.pro b/examples/statemachine/twowaybutton/twowaybutton.pro
index 212ba501d7..d9d8941750 100644
--- a/examples/statemachine/twowaybutton/twowaybutton.pro
+++ b/examples/statemachine/twowaybutton/twowaybutton.pro
@@ -5,3 +5,7 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS twowaybutton.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/twowaybutton
INSTALLS += target sources
+
+symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
+