diff options
Diffstat (limited to 'examples/quick/shared')
-rw-r--r-- | examples/quick/shared/quick_shared.qrc | 8 | ||||
-rw-r--r-- | examples/quick/shared/shared.h | 26 | ||||
-rw-r--r-- | examples/quick/shared/shared.qrc | 8 |
3 files changed, 17 insertions, 25 deletions
diff --git a/examples/quick/shared/quick_shared.qrc b/examples/quick/shared/quick_shared.qrc new file mode 100644 index 0000000000..9fc114dc89 --- /dev/null +++ b/examples/quick/shared/quick_shared.qrc @@ -0,0 +1,8 @@ +<RCC> + <qresource prefix="/quick/shared"> + <file>LauncherList.qml</file> + <file>SimpleLauncherDelegate.qml</file> + <file>Button.qml</file> + <file>images/back.png</file> + </qresource> +</RCC> diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index 7fd2f08a40..a7072daa89 100644 --- a/examples/quick/shared/shared.h +++ b/examples/quick/shared/shared.h @@ -45,32 +45,8 @@ {\ QGuiApplication app(argc,argv);\ QQuickView view;\ - QDir directory(QCoreApplication::applicationDirPath());\ - if (QGuiApplication::platformName() == QLatin1String("windows")) {\ - if (directory.absolutePath().endsWith("/debug", Qt::CaseInsensitive)\ - || directory.absolutePath().endsWith("/release", Qt::CaseInsensitive))\ - if (!directory.cdUp()) {\ - qWarning("Could not change to parent directory of '%s'",\ - qPrintable(QDir::toNativeSeparators(directory.absolutePath())));\ - return -1;\ - }\ - } else if (QGuiApplication::platformName() == QLatin1String("cocoa")) {\ - if (directory.absolutePath().endsWith(#NAME".app/Contents/MacOS"))\ - for (int i = 0; i < 3; ++i) {\ - if (!directory.cdUp()) {\ - qWarning("Could not change to parent directory of '%s'",\ - qPrintable(QDir::toNativeSeparators(directory.absolutePath())));\ - return -1;\ - }\ - }\ - }\ - const QString fileName(directory.absolutePath() + "/" #NAME ".qml");\ - if (!QFile::exists(fileName)) {\ - qWarning("Could not find file '%s'", qPrintable(QDir::toNativeSeparators(fileName)));\ - return -1;\ - }\ view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\ - view.setSource(QUrl::fromLocalFile(fileName)); \ + view.setSource(QUrl("qrc:///" #NAME ".qml")); \ if (QGuiApplication::platformName() == QLatin1String("qnx") || \ QGuiApplication::platformName() == QLatin1String("eglfs")) {\ view.setResizeMode(QQuickView::SizeRootObjectToView);\ diff --git a/examples/quick/shared/shared.qrc b/examples/quick/shared/shared.qrc new file mode 100644 index 0000000000..4ac856e66b --- /dev/null +++ b/examples/quick/shared/shared.qrc @@ -0,0 +1,8 @@ +<RCC> + <qresource prefix="/shared"> + <file>LauncherList.qml</file> + <file>SimpleLauncherDelegate.qml</file> + <file>Button.qml</file> + <file>images/back.png</file> + </qresource> +</RCC> |