Skip to content
Snippets Groups Projects
Commit 3d75c54b authored by Topi Reinio's avatar Topi Reinio Committed by The Qt Project
Browse files

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: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarLorn Potter <lorn.potter@jollamobile.com>
parent c7dff2e5
Branches
Tags
No related merge requests found
Showing
with 116 additions and 1 deletion
......@@ -3,6 +3,9 @@ TARGET = accelbubble
QT += quick
SOURCES = main.cpp
RESOURCES += \
accelbubble.qrc
app.files = \
$$files(*.qml) \
icon.png \
......
<RCC>
<qresource prefix="/">
<file>accelbubble.qml</file>
<file>content/Bluebubble2.png</file>
</qresource>
</RCC>
......@@ -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
<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>
......@@ -3,6 +3,9 @@ TARGET = grue
QT += quick
SOURCES = main.cpp
RESOURCES += \
qml.qrc
app.files = \
icon.png \
$$files(*.qml) \
......
<RCC>
<qresource prefix="/">
<file>grue.qml</file>
<file>grue.png</file>
</qresource>
</RCC>
......@@ -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
<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>
......@@ -3,6 +3,9 @@ TARGET = qmlqtsensors
QT += quick
SOURCES = main.cpp
RESOURCES += \
qmlqtsensors.qrc
app.files = \
$$files(*.qml) \
icon.png \
......
<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>
......@@ -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
<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>
......@@ -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
<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>
......@@ -3,6 +3,9 @@ TARGET = shakeit
QT += quick
SOURCES = main.cpp
RESOURCES += \
shakeit.qrc
app.files = \
$$files(*.qml) \
icon.png \
......
<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>
......@@ -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();\
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment