summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-05-22 12:45:49 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-23 00:53:40 (GMT)
commit3d75c54b8d0d055eff2a41cef7733b6204f8241c (patch)
tree084db4d8b89d68f39cb72697af279874b9ced66c /examples
parentc7dff2e520cbf6fcec414d0b04c2c133e5eb5af3 (diff)
downloadqtsensors-3d75c54b8d0d055eff2a41cef7733b6204f8241c.tar.gz
Sensors examples: Use resource system for QML examples
Adds resources (.qml, .js, images, etc.) used in QML examples as Qt resources. This enables running the examples successfully when shadow building, without copying the files around. Task-number: QTBUG-31076 Change-Id: I0f3352cffdc334f6139aac60acd3345710516d65 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/sensors/accelbubble/accelbubble.pro3
-rw-r--r--examples/sensors/accelbubble/accelbubble.qrc6
-rw-r--r--examples/sensors/cubehouse/cubehouse.pro3
-rw-r--r--examples/sensors/cubehouse/cubehouse.qrc13
-rw-r--r--examples/sensors/grue/qml.pro3
-rw-r--r--examples/sensors/grue/qml.qrc6
-rw-r--r--examples/sensors/maze/maze.pro3
-rw-r--r--examples/sensors/maze/maze.qrc21
-rw-r--r--examples/sensors/qmlqtsensors/qmlqtsensors.pro3
-rw-r--r--examples/sensors/qmlqtsensors/qmlqtsensors.qrc10
-rw-r--r--examples/sensors/qmlsensorgestures/qml.pro3
-rw-r--r--examples/sensors/qmlsensorgestures/qml.qrc9
-rw-r--r--examples/sensors/sensor_explorer/qml.pro3
-rw-r--r--examples/sensors/sensor_explorer/qml.qrc16
-rw-r--r--examples/sensors/shakeit/shakeit.pro3
-rw-r--r--examples/sensors/shakeit/shakeit.qrc10
-rw-r--r--examples/sensors/stub.h2
17 files changed, 116 insertions, 1 deletions
diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro
index 523ebf0..3986e4a 100644
--- a/examples/sensors/accelbubble/accelbubble.pro
+++ b/examples/sensors/accelbubble/accelbubble.pro
@@ -3,6 +3,9 @@ TARGET = accelbubble
QT += quick
SOURCES = main.cpp
+RESOURCES += \
+ accelbubble.qrc
+
app.files = \
$$files(*.qml) \
icon.png \
diff --git a/examples/sensors/accelbubble/accelbubble.qrc b/examples/sensors/accelbubble/accelbubble.qrc
new file mode 100644
index 0000000..f3ca2f0
--- /dev/null
+++ b/examples/sensors/accelbubble/accelbubble.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>accelbubble.qml</file>
+ <file>content/Bluebubble2.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/cubehouse/cubehouse.pro b/examples/sensors/cubehouse/cubehouse.pro
index 1fd1ef3..9f54308 100644
--- a/examples/sensors/cubehouse/cubehouse.pro
+++ b/examples/sensors/cubehouse/cubehouse.pro
@@ -12,3 +12,6 @@ app.files = \
target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/cubehouse
app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/cubehouse
INSTALLS += target app
+
+RESOURCES += \
+ cubehouse.qrc
diff --git a/examples/sensors/cubehouse/cubehouse.qrc b/examples/sensors/cubehouse/cubehouse.qrc
new file mode 100644
index 0000000..144151b
--- /dev/null
+++ b/examples/sensors/cubehouse/cubehouse.qrc
@@ -0,0 +1,13 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Cube.qml</file>
+ <file>cubehouse.qml</file>
+ <file>Room.qml</file>
+ <file>Table.qml</file>
+ <file>content/ground.jpg</file>
+ <file>content/wall.jpg</file>
+ <file>content/roof.jpg</file>
+ <file>content/qtlogo.png</file>
+ <file>mesh/table.3ds</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/grue/qml.pro b/examples/sensors/grue/qml.pro
index 7593538..d7444ca 100644
--- a/examples/sensors/grue/qml.pro
+++ b/examples/sensors/grue/qml.pro
@@ -3,6 +3,9 @@ TARGET = grue
QT += quick
SOURCES = main.cpp
+RESOURCES += \
+ qml.qrc
+
app.files = \
icon.png \
$$files(*.qml) \
diff --git a/examples/sensors/grue/qml.qrc b/examples/sensors/grue/qml.qrc
new file mode 100644
index 0000000..55b269b
--- /dev/null
+++ b/examples/sensors/grue/qml.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>grue.qml</file>
+ <file>grue.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/maze/maze.pro b/examples/sensors/maze/maze.pro
index 2ce2308..b57c0a9 100644
--- a/examples/sensors/maze/maze.pro
+++ b/examples/sensors/maze/maze.pro
@@ -13,3 +13,6 @@ app.files = \
target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/maze
app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/maze
INSTALLS += target app
+
+RESOURCES += \
+ maze.qrc
diff --git a/examples/sensors/maze/maze.qrc b/examples/sensors/maze/maze.qrc
new file mode 100644
index 0000000..1091619
--- /dev/null
+++ b/examples/sensors/maze/maze.qrc
@@ -0,0 +1,21 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Congratulation.qml</file>
+ <file>LabyrinthSquare.qml</file>
+ <file>lib.js</file>
+ <file>maze.qml</file>
+ <file>Mouse.qml</file>
+ <file>components/ApplicationWindow.qml</file>
+ <file>components/Button.qml</file>
+ <file>components/images/button_background_disabled.png</file>
+ <file>components/images/button_background_pressed.png</file>
+ <file>components/images/button_background_normal.png</file>
+ <file>content/00.png</file>
+ <file>content/start.png</file>
+ <file>content/mouse_down.gif</file>
+ <file>content/congratulations.gif</file>
+ <file>content/cheeseeating.gif</file>
+ <file>content/cheese.png</file>
+ <file>content/01.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.pro b/examples/sensors/qmlqtsensors/qmlqtsensors.pro
index 5275db5..b63bd6a 100644
--- a/examples/sensors/qmlqtsensors/qmlqtsensors.pro
+++ b/examples/sensors/qmlqtsensors/qmlqtsensors.pro
@@ -3,6 +3,9 @@ TARGET = qmlqtsensors
QT += quick
SOURCES = main.cpp
+RESOURCES += \
+ qmlqtsensors.qrc
+
app.files = \
$$files(*.qml) \
icon.png \
diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.qrc b/examples/sensors/qmlqtsensors/qmlqtsensors.qrc
new file mode 100644
index 0000000..2f6630b
--- /dev/null
+++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qmlqtsensors.qml</file>
+ <file>components/ApplicationWindow.qml</file>
+ <file>components/Button.qml</file>
+ <file>components/images/button_background_disabled.png</file>
+ <file>components/images/button_background_normal.png</file>
+ <file>components/images/button_background_pressed.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/qmlsensorgestures/qml.pro b/examples/sensors/qmlsensorgestures/qml.pro
index c24dd21..9bcba7f 100644
--- a/examples/sensors/qmlsensorgestures/qml.pro
+++ b/examples/sensors/qmlsensorgestures/qml.pro
@@ -10,3 +10,6 @@ app.files = \
target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/qmlsensorgestures
app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/qmlsensorgestures
INSTALLS += target app
+
+RESOURCES += \
+ qml.qrc
diff --git a/examples/sensors/qmlsensorgestures/qml.qrc b/examples/sensors/qmlsensorgestures/qml.qrc
new file mode 100644
index 0000000..af48a3e
--- /dev/null
+++ b/examples/sensors/qmlsensorgestures/qml.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/">
+ <file>Button.qml</file>
+ <file>GestureList.qml</file>
+ <file>GesturesView.qml</file>
+ <file>GestureView.qml</file>
+ <file>qmlsensorgestures.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/sensor_explorer/qml.pro b/examples/sensors/sensor_explorer/qml.pro
index e5b081f..e9fe0bf 100644
--- a/examples/sensors/sensor_explorer/qml.pro
+++ b/examples/sensors/sensor_explorer/qml.pro
@@ -12,3 +12,6 @@ app.files = \
target.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer
app.path = $$[QT_INSTALL_EXAMPLES]/qtsensors/sensor_explorer
INSTALLS += target app
+
+RESOURCES += \
+ qml.qrc
diff --git a/examples/sensors/sensor_explorer/qml.qrc b/examples/sensors/sensor_explorer/qml.qrc
new file mode 100644
index 0000000..3f11f3e
--- /dev/null
+++ b/examples/sensors/sensor_explorer/qml.qrc
@@ -0,0 +1,16 @@
+<RCC>
+ <qresource prefix="/">
+ <file>PropertyList.qml</file>
+ <file>SensorList.qml</file>
+ <file>sensor_explorer.qml</file>
+ <file>components/ApplicationWindow.qml</file>
+ <file>components/TextField.qml</file>
+ <file>components/Button.qml</file>
+ <file>components/images/button_background_disabled.png</file>
+ <file>components/images/textfield_background_normal.png</file>
+ <file>components/images/textfield_background_disabled.png</file>
+ <file>components/images/button_background_pressed.png</file>
+ <file>components/images/button_background_normal.png</file>
+ <file>content/listitem_select.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/shakeit/shakeit.pro b/examples/sensors/shakeit/shakeit.pro
index 7335191..cb36f73 100644
--- a/examples/sensors/shakeit/shakeit.pro
+++ b/examples/sensors/shakeit/shakeit.pro
@@ -3,6 +3,9 @@ TARGET = shakeit
QT += quick
SOURCES = main.cpp
+RESOURCES += \
+ shakeit.qrc
+
app.files = \
$$files(*.qml) \
icon.png \
diff --git a/examples/sensors/shakeit/shakeit.qrc b/examples/sensors/shakeit/shakeit.qrc
new file mode 100644
index 0000000..1a2c75d
--- /dev/null
+++ b/examples/sensors/shakeit/shakeit.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/">
+ <file>shakeit.qml</file>
+ <file>audio/loopy2a_mono.wav</file>
+ <file>audio/phone.wav</file>
+ <file>content/triangle.png</file>
+ <file>content/triangle2.png</file>
+ <file>content/triangle3.png</file>
+ </qresource>
+</RCC>
diff --git a/examples/sensors/stub.h b/examples/sensors/stub.h
index c74cffa..b105f93 100644
--- a/examples/sensors/stub.h
+++ b/examples/sensors/stub.h
@@ -45,7 +45,7 @@
{\
QGuiApplication app(argc,argv);\
QQuickView view;\
- view.setSource(QUrl::fromLocalFile(#NAME ".qml"));\
+ view.setSource(QUrl("qrc:///" #NAME ".qml"));\
view.show();\
return app.exec();\
}