From 3d75c54b8d0d055eff2a41cef7733b6204f8241c Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 22 May 2013 14:45:49 +0200 Subject: 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 Reviewed-by: Lorn Potter --- examples/sensors/accelbubble/accelbubble.pro | 3 +++ examples/sensors/accelbubble/accelbubble.qrc | 6 ++++++ examples/sensors/cubehouse/cubehouse.pro | 3 +++ examples/sensors/cubehouse/cubehouse.qrc | 13 +++++++++++++ examples/sensors/grue/qml.pro | 3 +++ examples/sensors/grue/qml.qrc | 6 ++++++ examples/sensors/maze/maze.pro | 3 +++ examples/sensors/maze/maze.qrc | 21 +++++++++++++++++++++ examples/sensors/qmlqtsensors/qmlqtsensors.pro | 3 +++ examples/sensors/qmlqtsensors/qmlqtsensors.qrc | 10 ++++++++++ examples/sensors/qmlsensorgestures/qml.pro | 3 +++ examples/sensors/qmlsensorgestures/qml.qrc | 9 +++++++++ examples/sensors/sensor_explorer/qml.pro | 3 +++ examples/sensors/sensor_explorer/qml.qrc | 16 ++++++++++++++++ examples/sensors/shakeit/shakeit.pro | 3 +++ examples/sensors/shakeit/shakeit.qrc | 10 ++++++++++ examples/sensors/stub.h | 2 +- 17 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 examples/sensors/accelbubble/accelbubble.qrc create mode 100644 examples/sensors/cubehouse/cubehouse.qrc create mode 100644 examples/sensors/grue/qml.qrc create mode 100644 examples/sensors/maze/maze.qrc create mode 100644 examples/sensors/qmlqtsensors/qmlqtsensors.qrc create mode 100644 examples/sensors/qmlsensorgestures/qml.qrc create mode 100644 examples/sensors/sensor_explorer/qml.qrc create mode 100644 examples/sensors/shakeit/shakeit.qrc (limited to 'examples') diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro index 523ebf0d..3986e4a2 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 00000000..f3ca2f05 --- /dev/null +++ b/examples/sensors/accelbubble/accelbubble.qrc @@ -0,0 +1,6 @@ + + + accelbubble.qml + content/Bluebubble2.png + + diff --git a/examples/sensors/cubehouse/cubehouse.pro b/examples/sensors/cubehouse/cubehouse.pro index 1fd1ef3e..9f543082 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 00000000..144151b0 --- /dev/null +++ b/examples/sensors/cubehouse/cubehouse.qrc @@ -0,0 +1,13 @@ + + + Cube.qml + cubehouse.qml + Room.qml + Table.qml + content/ground.jpg + content/wall.jpg + content/roof.jpg + content/qtlogo.png + mesh/table.3ds + + diff --git a/examples/sensors/grue/qml.pro b/examples/sensors/grue/qml.pro index 7593538c..d7444ca8 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 00000000..55b269b9 --- /dev/null +++ b/examples/sensors/grue/qml.qrc @@ -0,0 +1,6 @@ + + + grue.qml + grue.png + + diff --git a/examples/sensors/maze/maze.pro b/examples/sensors/maze/maze.pro index 2ce23089..b57c0a98 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 00000000..10916193 --- /dev/null +++ b/examples/sensors/maze/maze.qrc @@ -0,0 +1,21 @@ + + + Congratulation.qml + LabyrinthSquare.qml + lib.js + maze.qml + Mouse.qml + components/ApplicationWindow.qml + components/Button.qml + components/images/button_background_disabled.png + components/images/button_background_pressed.png + components/images/button_background_normal.png + content/00.png + content/start.png + content/mouse_down.gif + content/congratulations.gif + content/cheeseeating.gif + content/cheese.png + content/01.png + + diff --git a/examples/sensors/qmlqtsensors/qmlqtsensors.pro b/examples/sensors/qmlqtsensors/qmlqtsensors.pro index 5275db55..b63bd6ac 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 00000000..2f6630b0 --- /dev/null +++ b/examples/sensors/qmlqtsensors/qmlqtsensors.qrc @@ -0,0 +1,10 @@ + + + qmlqtsensors.qml + components/ApplicationWindow.qml + components/Button.qml + components/images/button_background_disabled.png + components/images/button_background_normal.png + components/images/button_background_pressed.png + + diff --git a/examples/sensors/qmlsensorgestures/qml.pro b/examples/sensors/qmlsensorgestures/qml.pro index c24dd216..9bcba7fd 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 00000000..af48a3ed --- /dev/null +++ b/examples/sensors/qmlsensorgestures/qml.qrc @@ -0,0 +1,9 @@ + + + Button.qml + GestureList.qml + GesturesView.qml + GestureView.qml + qmlsensorgestures.qml + + diff --git a/examples/sensors/sensor_explorer/qml.pro b/examples/sensors/sensor_explorer/qml.pro index e5b081f9..e9fe0bf5 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 00000000..3f11f3e9 --- /dev/null +++ b/examples/sensors/sensor_explorer/qml.qrc @@ -0,0 +1,16 @@ + + + PropertyList.qml + SensorList.qml + sensor_explorer.qml + components/ApplicationWindow.qml + components/TextField.qml + components/Button.qml + components/images/button_background_disabled.png + components/images/textfield_background_normal.png + components/images/textfield_background_disabled.png + components/images/button_background_pressed.png + components/images/button_background_normal.png + content/listitem_select.png + + diff --git a/examples/sensors/shakeit/shakeit.pro b/examples/sensors/shakeit/shakeit.pro index 73351918..cb36f739 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 00000000..1a2c75d8 --- /dev/null +++ b/examples/sensors/shakeit/shakeit.qrc @@ -0,0 +1,10 @@ + + + shakeit.qml + audio/loopy2a_mono.wav + audio/phone.wav + content/triangle.png + content/triangle2.png + content/triangle3.png + + diff --git a/examples/sensors/stub.h b/examples/sensors/stub.h index c74cffa8..b105f930 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();\ } -- cgit v1.2.3