summaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-02-26 13:57:50 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2010-02-26 13:57:50 +0100
commit9a52f0dd19a1d3314b435fade0a5338609e838a1 (patch)
tree9be84e54fdc7b375b2778705659176d6ecbfc6b5 /example
parent754a63ff40fd78be7bc0bf70c8b072d079e1fac9 (diff)
Add scripting support.HEADmaster
Diffstat (limited to 'example')
-rw-r--r--example/example.pro2
-rw-r--r--example/main.cpp11
2 files changed, 10 insertions, 3 deletions
diff --git a/example/example.pro b/example/example.pro
index 9b8f895..b1fd669 100644
--- a/example/example.pro
+++ b/example/example.pro
@@ -4,7 +4,7 @@
#
#-------------------------------------------------
-QT += core gui
+QT += core gui script
TARGET = example
TEMPLATE = app
diff --git a/example/main.cpp b/example/main.cpp
index e8716bc..e66f03a 100644
--- a/example/main.cpp
+++ b/example/main.cpp
@@ -1,5 +1,7 @@
#include <QtGui/QApplication>
#include "remotecontrolwidget.h"
+#include "scriptadapter.h"
+#include "components/scriptui.h"
#include "components/locationui.h"
#include "components/batterybutton.h"
#include "components/powerbutton.h"
@@ -9,8 +11,8 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
RemoteControlWidget w;
- LocationUi l;
- w.addToolBoxPage(&l);
+ LocationUi locationUi;
+ w.addToolBoxPage(&locationUi);
BatteryButton batteryButton;
w.addMenuButton(&batteryButton);
@@ -18,6 +20,11 @@ int main(int argc, char *argv[])
PowerButton powerButton;
w.addMenuButton(&powerButton);
+ ScriptAdapter adapter;
+ adapter.addScriptInterface("location", locationUi.scriptInterface());
+ ScriptUi scriptUi(&adapter);
+ w.addToolBoxPage(&scriptUi);
+
w.show();
return a.exec();
}