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

QML Map panning is weird in layouts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • None
    • Linux/Wayland

    Description

      This minimal_map example, with qml like this:

       

      import QtQuick
      import QtLocation
      import QtPositioning
      
      Window {
          width: Qt.platform.os == "android" ? Screen.width : 512
          height: Qt.platform.os == "android" ? Screen.height : 512
          visible: true
          
          Plugin {
              id: mapPlugin
              name: "osm"
          }
          
          Map {
                  anchors.fill: parent
                  id: map
                  plugin: mapPlugin
                  center: QtPositioning.coordinate(59.91, 10.75) // Oslo
                  zoomLevel: 14
          
                  DragHandler {
                      id: drag
                      target: null
                      onTranslationChanged: (delta) =>  map.pan(-delta.x, -delta.y)
                  }
              }
      }
      

      works as expected but if the Map is placed in a Layout, like this:

      import QtQuick
      import QtLocation
      import QtPositioning
      import QtQuick.Layouts
      
      Window {
          width: Qt.platform.os == "android" ? Screen.width : 512
          height: Qt.platform.os == "android" ? Screen.height : 512
          visible: true    
          Plugin {
              id: mapPlugin
              name: "osm"
          }
      
          ColumnLayout
          {
              anchors.fill: parent
              id: layout1
              Item {
                  Layout.fillWidth: true
                  Layout.minimumHeight: 10
              }
              
              Map {
                  id: map
                  Layout.fillWidth: true
                  Layout.fillHeight: true
                  
                  plugin: mapPlugin
                  center: QtPositioning.coordinate(59.91, 10.75) // Oslo
                  zoomLevel: 14
                  
                  DragHandler {
                      id: drag
                      target: null
                      onTranslationChanged: (delta) =>  map.pan(-delta.x, -delta.y)
                  }
              }
          }
      } 

      panning suddenly becomes choppier, and horizontal dragging makes the map also pan vertically.
      working.webm
      strange.webm

       

      Update: After logging out (to try X11) and back in everything seems smoother, but the vertical panning is still there:
      working2.webm

      strange2.webm

      Attachments

        1. working.webm
          296 kB
        2. strange.webm
          406 kB
        3. working2.webm
          296 kB
        4. strange2.webm
          323 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            matthias_rauter Matthias Rauter
            heneri Henrik Eriksson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes