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

A DragHandler in an Item which opens a popup enables Flickable to steal mouse events from a Slider in said popup

    XMLWordPrintable

Details

    • Windows

    Description

      The code below reproduces the issue. You need to long-press one of the blue squares, then a popup will appear. The popup contains a slider. Quite often when trying to drag the Slider's handle the Flickable (TableView) will kick in instead and start moving around its entire content. It's easier to trigger this behavior when dragging the handle vertically but it also happens horizontally / in arbitrary direction. IMHO this should not happen and looks like some kind of a weird interaction between the Slider, the DragHandler and the Flickable. Thank you in advance for your help. PS. I believe this happens when the point where you click on the slider is above something with a DragHandler in the background. Probably a duplicate of: 

      1. QTBUG-87815
      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      import QtQuick.Shapes
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          TableView {
              anchors.fill: parent
              model: 5
              delegate: ColumnLayout {
                  Label {
                      text: "ABC"
                      font.pixelSize: 224
                  }
      
                  Slider {
                      from: 1
                      to: 10
                      stepSize: 1
                      snapMode: Slider.SnapAlways
                      value: 5
                  }
      
                  Rectangle {
                      x: 0
                      y: 0
                      width: 200
                      height: 100
                      color: "red"
      
                      Rectangle {
                          x: 100
                          width: 100
                          height: 100
                          color: "green"
      
                          Repeater {
                              model: 3
      
                              delegate: Shape {
                                  required property var index
      
                                  y: index * 50
      
                                  containsMode: Shape.FillContains
      
                                  ShapePath {
                                      startX: 0; startY: 0
                                      PathLine { x: 50; y: 0 }
                                      PathLine { x: 50; y: 50 }
                                      PathLine { x: 0; y: 50 }
                                      PathLine { x: 0; y: 0 }
                                      fillColor: "blue"
                                  }
      
                                  DragHandler {
                                      target: null
                                      onActiveChanged:  {
      
                                      }
                                  }
      
                                  TapHandler {
                                      onLongPressed: {
                                          var pt = mapToItem(Overlay.overlay, point.position)
                                          popup.x = pt.x
                                          popup.y = pt.y
                                          popup.open()
                                      }
                                  }
      
                                  Popup {
                                      id: popup
      
                                      ButtonGroup {
                                          id: btnGroup
                                      }
      
                                      parent: Overlay.overlay
      
                                      ColumnLayout {
      
                                          Button {
                                              ButtonGroup.group: btnGroup
                                              text: "Whatever"
                                              checkable: true
                                              checked: true
                                          }
      
                                          Slider {
                                              from: 1
                                              to: 10
                                              stepSize: 1
                                              snapMode: Slider.SnapAlways
                                              value: 5
                                          }
                                      }
                                  }
                              }
                          }
                      }
                  }
              }
              ScrollBar.horizontal: ScrollBar {}
              ScrollBar.vertical: ScrollBar {}
          }
      
      }
       

       

       

      Attachments

        Issue Links

          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
              sadaszewski Stanislaw Adaszewski
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes