summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/rogue
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine/rogue')
-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
6 files changed, 38 insertions, 4 deletions
diff --git a/examples/statemachine/rogue/main.cpp b/examples/statemachine/rogue/main.cpp
index b52b55fccf..2939e4a7c5 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 d125a862b6..f2dcde3375 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 d653beb2d0..9e401aab82 100644
--- a/examples/statemachine/rogue/rogue.pro
+++ b/examples/statemachine/rogue/rogue.pro
@@ -10,3 +10,6 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/statemachine/rogue
INSTALLS += target sources
QT += widgets
+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 2700a87754..fa62362ecc 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