Bug 336574 - simple Qt5 qml app does not start
Summary: simple Qt5 qml app does not start
Status: REPORTED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-22 11:04 UTC by Dibala Vasiliy
Modified: 2021-03-09 22:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-6832-0.html (296 bytes, text/html)
2015-08-17 08:21 UTC, Alessandro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dibala Vasiliy 2014-06-22 11:04:55 UTC
1. compile from trunk use configuration:
cmake -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DQT5BUILD=TRUE -DBUILD_MARBLE_TESTS=NO -DCMAKE_INSTALL_PREFIX=~/Work/marble/export ~/Work/marble/sources:

2. launch simple quick 2.0 app:
import QtQuick 2.0
import org.kde.edu.marble 0.11

MarbleWidget {
  projection: "Mercator"
  mapThemeId: "earth/openstreetmap/openstreetmap.dgml"
}

qmlscene -I /home/vasily/Work/marble/export/lib/marble/plugins/ /home/vasily/Work/marble/sources1/examples/qml/test.qml
and got error:

vasily@vasily-pc:~/Work/marble/build$ qmlscene -I /home/vasily/Work/marble/export/lib/marble/plugins/ /home/vasily/Work/marble/sources1/examples/qml/test.qml 
QObject: Cannot create children for a parent that is in a different thread.
(Parent is MarbleDeclarativePlugin(0x7fae4406fc00), parent's thread is QThread(0x1f65910), current thread is QThread(0x1bd58e0)
QIODevice::write: device not open
QIODevice::write: device not open
QIODevice::write: device not open
QIODevice::write: device not open
QIODevice::write: device not open
QIODevice::write: device not open

3. try to launch as Quich 1.0 app:

import QtQuick 1.0
import org.kde.edu.marble 0.11

MarbleWidget {
  projection: "Mercator"
  mapThemeId: "earth/openstreetmap/openstreetmap.dgml"
}



vasily@vasily-pc:~/Work/marble/build$ qmlviewer -I /home/vasily/Work/marble/export/lib/marble/plugins/ /home/vasily/Work/marble/sources1/examples/qml/test.qml 
Qml debugging is enabled. Only use this in a safe environment!
file:///home/vasily/Work/marble/sources1/examples/qml/test.qml:2:1: plugin cannot be loaded for module "org.kde.edu.marble": Unknown error 
     import org.kde.edu.marble 0.11 
     ^





Reproducible: Always

Steps to Reproduce:
1. compile
2. launch
3. ???
4. no profit



workstation:
Ubuntu 12.04 64 bit
Qt 5.3 downloaded from Qt-project site
Comment 1 Alessandro 2015-08-11 09:17:47 UTC
I have exactly the same problem, Qt 5.5 on gentoo x86_64
Comment 2 Dennis Nienhüser 2015-08-11 20:52:32 UTC
For Qt Quick 1.1 it was necessary to set QML_IMPORT_PATH. Otherwise you get that import error. Setting QML_IMPORT_TRACE=1 is useful to debug such problems.

Just recently we moved to Qt Quick 2 in the master branch and upgraded org.kde.edu.marble from 0.11 to 0.20. I changed the declarative plugin to a library-style plugin which means that at the moment qmlviewer will not be able to import org.kde.edu.marble 0.20. This was easier to get it running on Android, but I might change that until the next release to enable direct .qml loading again. When that is done, QML2_IMPORT_PATH must be set.
Comment 3 Alessandro 2015-08-17 08:21:16 UTC
Created attachment 94075 [details]
attachment-6832-0.html

Thank you Dennis. I've found the example in src/examples/cpp/marbleQuick2
which is working with QtQuick 2. I can reproduce it in my app only manually
copying src/lib/marble/declarative/*.h files in the install path. These
headers are not normally installed like others.
Comment 4 Justin Zobel 2021-03-09 22:51:35 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.