diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-02-23 11:39:58 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-02-24 07:59:02 +0000 |
commit | 1cb3ec6e862e99b60aaad488ccb1696c10218365 (patch) | |
tree | 2e5518158f3feba3afbbd631980f96833b3e530a /examples/location | |
parent | ec003eb637ced35e7ac3d6e0c256f1244ce0b443 (diff) | |
download | qtlocation-1cb3ec6e862e99b60aaad488ccb1696c10218365.tar.gz |
Use resource file for places_list example
This avoids issues with relative qml path locations when calling the
binary.
Change-Id: I6f1c808e8f8abd88a0a3bf39f35a2f0d65b9ed93
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location')
-rw-r--r-- | examples/location/places_list/main.cpp | 2 | ||||
-rw-r--r-- | examples/location/places_list/places_list.pro | 6 | ||||
-rw-r--r-- | examples/location/places_list/resources.qrc | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/examples/location/places_list/main.cpp b/examples/location/places_list/main.cpp index a2795657..2db67f78 100644 --- a/examples/location/places_list/main.cpp +++ b/examples/location/places_list/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char **argv) { QGuiApplication app(argc,argv); QQuickView view; - view.setSource(QUrl::fromLocalFile("places_list.qml")); + view.setSource(QUrl(QStringLiteral("qrc:///places_list.qml"))); view.show(); return app.exec(); } diff --git a/examples/location/places_list/places_list.pro b/examples/location/places_list/places_list.pro index 68a6d494..f2fddb5a 100644 --- a/examples/location/places_list/places_list.pro +++ b/examples/location/places_list/places_list.pro @@ -4,9 +4,9 @@ TEMPLATE = app QT += quick qml network SOURCES = main.cpp -qmlcontent.files += $$files(*.qml) +RESOURCES += \ + resources.qrc target.path = $$[QT_INSTALL_EXAMPLES]/location/places_list -qmlcontent.path = $$[QT_INSTALL_EXAMPLES]/location/places_list +INSTALLS += target -INSTALLS += target qmlcontent diff --git a/examples/location/places_list/resources.qrc b/examples/location/places_list/resources.qrc new file mode 100644 index 00000000..4cc332e2 --- /dev/null +++ b/examples/location/places_list/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>places_list.qml</file> + </qresource> +</RCC> |