QQmlComponent: Component is not ready
-
Hi,
I keep receiving QQmlComponent: Component is not ready when I try to start the following qml file as dialog.
I basically have mainwindow which contains a button when this button is clicked I attempt to start the map as follows:
void MainWindow::on_openMapBtn_clicked() { QQmlEngine engine; QMLCommunicationAgent agent; engine.rootContext()->setContextProperty("agent", &agent); QQmlComponent component(&engine, QUrl::fromLocalFile("map.qml")); component.create(); }
I read some posts that suggest that the .qml file not found. So I added the .qml file to the resources file inside the / folder or perfix. I then tried
QQmlComponent component(&engine, QUrl::fromLocalFile("qrc:/map.qml"));
and
QQmlComponent component(&engine, QUrl::fromLocalFile(":/map.qml"));
no success.
-
When I used errors, I got:
module "QtPositioning" version 5.5 is not installed
QQmlComponent: Component is not readyI started the Qt Maintenance Tool > Add or remove components > expanded Qt 5.5 but I didn't seem to find the package to install QtPositioning and when I select packages they don't list what is included in the package.
Which package should I install?
-
I changed the import statements from
import QtPositioning 5.5 import QtLocation 5.5
to
import QtPositioning 5.2 import QtLocation 5.2
and I got past the module "QtPositioning" version 5.5 is not installed
I ran the Qt Maintenance Tool > Add or remove components > expanded Qt 5.5>source components>add-ons and found that qtlocation 5.5.1-0 is checked.
Any idea why this is happening?
-
@WhatIf Looks like there is no
QtPositioning 5.5
but just5.2
http://doc.qt.io/qt-5/qtpositioning-index.html -
import QtQuick 2.0
import QtPositioning 5.5
import QtLocation 5.6http://doc.qt.io/qt-5/qtlocation-places-map-example.html
If I change
import QtPositioning 5.5 import QtLocation 5.6
to
import QtPositioning 5.2 import QtLocation 5.2
the program compiles fine but it doesn't display the map at all and I get
qml: Plugin Error (osm): The service provider does not support the QPlaceManager type.
in the application output.
I have been trying to get the map app to work for months now with no success.
-
@WhatIf QPlaceManager was introduced in
Qt 5.6
and you are usingQt 5.5
.
I would suggest you to update to Qt 5.6 (LTS) or Qt 5.7 since most of the problems that you encounter seems to be taken care of.