Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86377

No window set in QDeclarativeGeoMap created from QQuickWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0
    • Location, Quick: Widget
    • None
    • Windows

    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"
        }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            matthias_rauter Matthias Rauter
            artur.kuznetcov Artur Kuznetcov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes