summaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-07-13 01:33:20 +0300
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-07-13 15:18:21 +0300
commitf1ed8748b18537beb6160f8f97ae3dcca0274309 (patch)
tree1d98e636db572b0ba07c5edd28517aca44b3aa80 /subsurface-helper.cpp
parentfe38a768f2b1375a4201e271da52fc1f5712e9a0 (diff)
downloadsubsurface-f1ed8748b18537beb6160f8f97ae3dcca0274309.tar.gz
map-widget: fix chronology of QML class registration
The QML types needs to be registered before the MainWindow instance is created on the desktop version, otherwise the MapWidget instance will be created and it will fail with a missing QML namespace. In subsurface-helper.cpp, move register_qml_types() from run_ui() to init_ui(), as later in init_ui(), MainWindow is instantiated for the first time in the desktop version. Ref #1500 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index b58f8b4aa..b533e7e91 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -33,6 +33,7 @@ QObject *qqWindowObject = NULL;
void init_ui()
{
init_qt_late();
+ register_qml_types();
#ifndef SUBSURFACE_MOBILE
PluginManager::instance().loadPlugins();
@@ -97,7 +98,6 @@ void register_qml_types()
void run_ui()
{
- register_qml_types();
#ifdef SUBSURFACE_MOBILE
QQmlApplicationEngine engine;