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

MouseArea inside ScrollView(QtQuick.Controls 2.x) will lost focus after making a pressAndMove-action exceed a specific distance

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.13.1
    • None

    Description

      As the topic mentioned, in my situation, the scrollview has a child that has a mouseare inside. When I press inside the mouseare, everything is ok, but if I make a pressAndMove-action exceed a specific distance, the scrollbar will show and the mouseare lost focus, the pressd property of mouseare force to be false as well.

      My testing code as below,  the cursor shape change from closedhand to openhand so I can know the pressed property has forced to be false.

      //代码占位符
      import QtQuick 2.12
      import QtQuick.Controls 2.12
      ScrollView {
          width: 200
          height: 200
          clip: true
      
          Label {
              text: "ABC"
              font.pixelSize: 224
              MouseArea {
                  id: aamouse
                  anchors.fill: parent
                  cursorShape: pressed?Qt.ClosedHandCursor:Qt.OpenHandCursor
              }
          }
      }
      

       

      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
            je0000 Jadyn Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes