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

No window set in QDeclarativeGeoMap created from QQuickWidget

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Location, Quick: Widget
    • Labels:
      None
    • Platform/s:
      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

            Assignee:
            paangele Paolo Angelelli
            Reporter:
            artur.kuznetcov Artur Kuznetcov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes