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

[REG 5.13 -> 5.14 --> 6.0.3] In a test, Flickable's movement{Started,Ended} not fired despite visually moving

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.2, 5.15.2, 6.0.3
    • None

    Description

      In a test, if one uses mouseDrag() over a flickable for some short distance [1], the flickable's content will start moving, but movement{Started,Ended} signals won't fire.

      This seems to start happening in Qt 5.14. In the earlier versions, the event would fire, but I don't see the move visually. I'm not sure which behavior is correct, but it's ought to be consistent.

      One may workaround this by using mousePress(), a pair of mouseMove(), and mouseRelease(), to split up mouse moving events.

      The problem can be reproduced by running the test case below.

      [1] I'm not sure, but in this case it's 25 pixels across 150-pixel-high flickable.

      import QtQuick 2.0
      import QtQuick.Window 2.2
      
      import QtTest 1.9
      
      Item {
          width: 640
          height: 480
      
          Flickable {
              id: flickme
              anchors.left: parent.left
              anchors.top: parent.left
      
              width: 288
              height: 150
      
              contentHeight: 960
      
              Rectangle {
                  anchors.fill: parent
      
                  gradient: Gradient {
                      GradientStop { position: 0.0; color: "green" }
                      GradientStop { position: 1.0; color: "blue" }
                  }
              }
      
              onMovementStarted: {
                  console.log('movement started');
              }
      
              onMovementEnded: {
                  console.log('movement ended');
              }
          }
      
          TestCase {
              name: "FlickableMovement"
              when: windowShown
              
              SignalSpy {
                  id: spy
                  target: flickme
                  signalName: "movementEnded"
              }
      
              function test_movementEvents() {
                  var x = flickme.width / 2;
                  var y = flickme.height / 2;
                  var dy = flickme.height / 6;
      
                  console.log(`x=${x} y=${y} dy=${dy}`);
                  mouseDrag(flickme, x, y, 0, -dy);
      
                  spy.wait();
                  compare(spy.count, 1);
              }
          }
      }
      

      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
            peat-psuwit Ratchanan Srirattanamet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes