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

Dragging descendant controls causes Map to move

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.5
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      If Map item contains sub-child elements dragging them or selecting content by mouse in TextEdit causes Map content to move (map panning). Code example:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      import QtLocation       5.12
      import QtPositioning    5.12
      
      ApplicationWindow {
          Map {
              Rectangle {
                  ListView {
      
                  }
      
                  Slider {
      
                  }
      
                  Button {
      
                  }
      
                  TextEdit {
      
                  }
              }
          }
      }
      

      Reproducible with any control: ListView delegate, TextEdit, Button, etc. If I move Rectangle outside the Map element (make its sibling), then I can solve the problem by adding MouseArea to the Rectangle like this:

      MouseArea {
          preventStealing:true
          propagateComposedEvents: true
          hoverEnabled:   true
          onWheel:        { wheel.accepted = true; }
          onPressed:      { mouse.accepted = true; }
          onReleased:     { mouse.accepted = true; }
          onPressAndHold: { mouse.accepted = true; }
      }
      

      which prevents mouse events propagation to the Map, so Map does not move, pan unintentionally any more: https://stackoverflow.com/a/58978749/630169

      It it bug or expected behavior so I can't place items inside Map element as it catches their mouse events and starts to pan, zoom unintentionally?

        Attachments

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            alekseyka Aleksey Kontsevich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes