summaryrefslogtreecommitdiffstats
path: root/sample-qml/main.cpp
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-02 11:37:58 +0900
committerTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-02 11:44:24 +0900
commit346d1b3492fcbc26e7bff085b5d480fd7a627911 (patch)
tree33aa09304daa26b9c47d86d6bd6e9949fb0360ce /sample-qml/main.cpp
parent6130b67afe48de7eb0e4594d3210963b88e93fe5 (diff)
sample-qml: load qml from Qt resources
embed every assets in the binary and load its contents from there Change-Id: If0ca9342f82ab3ac8badf6bd75755a24001d2da7 Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'sample-qml/main.cpp')
-rw-r--r--sample-qml/main.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/sample-qml/main.cpp b/sample-qml/main.cpp
index 9238a9b..670decc 100644
--- a/sample-qml/main.cpp
+++ b/sample-qml/main.cpp
@@ -30,22 +30,10 @@ int main(int argc, char *argv[])
enabled = mp_libHomeScreen->renderAppToAreaAllowed(appcategory, FULLSCREEN);
if(enabled)
{
- QString target(getenv("AFM_APP_INSTALL_DIR"));
- qDebug("AFM_APP_INSTALL_DIR is " + target.toLatin1());
+ engine.addImportPath(QStringLiteral(":/imports"));
+ engine.addImportPath(QStringLiteral(":/dummyimports"));
- if(NULL == target)
- {
- target = ".";
- }
-
- QString load_path;
- load_path = target + "/imports";
- engine.addImportPath(load_path);
- load_path = target + "/dummyimports";
- engine.addImportPath(load_path);
- load_path = target + "/main.qml";
-
- engine.load(QUrl(load_path));
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
std::vector<int> surfaceIdList;
int pid = getpid();