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

Crash if window is clicked while MapItemView is loading items with zoomLevel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 6.10.0
    • Location
    • None
    • All

      Solution for QTBUG-134438 introduced one crash-bug. If window is clicked while MapItemView is putting items on the map, QDeclarativeGeoMapQuickItem::contains() is called before QDeclarativeGeoMapQuickItem::updatePolish(), thus matrix_ member is still not initialized.

      Can be reproduced with the following simple QML:

      import QtQuick
      import QtLocation
      import QtPositioning
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Map crash test")
      
          Map {
              id: map
              anchors.fill: parent
      
              plugin: Plugin {
                  preferred: [ "osm"]
              }
      
              center: QtPositioning.coordinate(59.438045, 24.745105)
              zoomLevel: 14
      
              MapItemView{
                  id: allNetworksMapView
                  model: ListModel{
                      id: mapItemsModel
                      Component.onCompleted: {
                          for(var i = 0; i < 10000; i++){
                              insert(i, {
                                  "coordinate": QtPositioning.coordinate(59.438045 + (Math.random() - 0.5) * 0.01, 24.745105 + (Math.random() - 0.5) * 0.025)
                              })
                          }
                      }
                  }
      
                  delegate: MapQuickItem {
                      id: topDelegate
                      coordinate: model.coordinate
                      zoomLevel: 14 // Remove this, and crash is gone.
                      sourceItem: Rectangle{
                          color: "red"
                          width: 3
                          height: 3
                      }
                  }
              }
      
              Text{
                  id: infoText
                  anchors.top: parent.top
                  anchors.horizontalCenter: parent.horizontalCenter
                  font.pixelSize: 18
                  text: "Click on the map while items are popping up."
              }
          }
      }
      

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

            matthias_rauter Matthias Rauter
            kiibimees Lauri Laanmets
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes