summaryrefslogtreecommitdiffstats
path: root/subsurface-mobile-helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r--subsurface-mobile-helper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index e2b32d3b2..8dd28f60d 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -31,6 +31,19 @@ void run_ui()
qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
QQmlApplicationEngine engine;
+#if __APPLE__
+ // when running the QML UI on a Mac the deployment of the QML Components seems
+ // to fail and the search path for the components is rather odd - simply the
+ // same directory the executable was started from <bundle>/Contents/MacOS/
+ // To work around this we need to manually copy the components at install time
+ // to Contents/Frameworks/qml and make sure that we add the correct import path
+ QStringList importPathList = engine.importPathList();
+ Q_FOREACH(QString importPath, importPathList) {
+ if (importPath.contains("MacOS"))
+ engine.addImportPath(importPath.replace("MacOS", "Frameworks"));
+ }
+ qDebug() << "QML import path" << engine.importPathList();
+#endif
engine.addImportPath("qrc://imports");
DiveListModel diveListModel;
QSortFilterProxyModel *sortModel = new QSortFilterProxyModel(0);