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 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 @@ + + + accelbubble.qml + content/Bluebubble2.png + + 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 @@ + + + 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 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 @@ + + + grue.qml + grue.png + + 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 @@ + + + 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 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 @@ + + + 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 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 @@ + + + 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 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 @@ + + + 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 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 @@ + + + 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 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();\ } -- cgit v1.2.1