Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.0
-
None
Description
When creating qml map view in QQuickWidget there is no window set for it so line
connect(window(), &QQuickWindow::beforeSynchronizing, this, &QDeclarativeGeoMap::updateItemToWindowTransform, Qt::DirectConnection);
produces warning
QObject::connect(QQuickWindow, MapView_QMLTYPE_0): invalid nullptr parameter
trivial example below will reproduce the problem:
main.cpp
#include <QApplication> #include <QWidget> #include <QHBoxLayout> #include <QQuickWidget> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; QHBoxLayout* l = new QHBoxLayout; QQuickWidget* qw = new QQuickWidget; qw->setSource(QUrl::fromLocalFile("../untitled3/MapView.qml")); l->addWidget(qw); w.setLayout(l); w.show(); return a.exec(); }
MapView.qml
import QtLocation 5.15 Map { width: 300 height: 300 plugin: Plugin { name: "osm" } }