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

Dragging descendant controls causes Map to move

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.5
    • None
    • 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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jirauser39314 user-45b5b (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes