summaryrefslogtreecommitdiffstats
path: root/demos/qmlcustomlegend/main.cpp
diff options
context:
space:
mode:
authorHeikkinen Miikka <miikka.heikkinen@digia.com>2013-05-22 09:49:28 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2013-05-22 10:12:28 +0300
commitabf0d5005e357dd2fe59ccf02412687f72e56cb5 (patch)
tree00d421bf283728f936693d280b2469cb027d342c /demos/qmlcustomlegend/main.cpp
parente2eb16a7c3b113365d1de6a9d5c04b7d31147432 (diff)
Fix qml application deployment for android
Change-Id: I5a693f3ca7d6110505f8e6d276f53825e1a5961b Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'demos/qmlcustomlegend/main.cpp')
-rw-r--r--demos/qmlcustomlegend/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/demos/qmlcustomlegend/main.cpp b/demos/qmlcustomlegend/main.cpp
index 16096354..85b396b7 100644
--- a/demos/qmlcustomlegend/main.cpp
+++ b/demos/qmlcustomlegend/main.cpp
@@ -20,13 +20,19 @@
#include <QApplication>
#include <QtDeclarative/QDeclarativeEngine>
+#include <QDir>
#include "qmlapplicationviewer.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
- viewer->addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QLatin1String("imports")));
+#ifdef Q_OS_ANDROID
+ viewer->addImportPath(QString::fromLatin1("assets:/imports"));
+ viewer->engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), QString::fromLatin1("lib")));
+#else
+ viewer->addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), QString::fromLatin1("imports")));
+#endif
//viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer->setSource(QUrl("qrc:/qml/qmlcustomlegend/loader.qml"));