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

qmltestrunner can't handle drag event as expected

    XMLWordPrintable

Details

    • ada9dd41c83aad3890b8f01a98fdbeae04528eba

    Description

      tst_drag.qml
      import QtQuick 2.0
      import QtTest 1.0
      
      Rectangle{
          id: root
          width:200
          height:200
      
          Rectangle {
              id:container
              width:20
              height:20
              color: "blue"
              MouseArea {
                  id:mouseArea; anchors.fill : parent
                  drag.maximumX: 180
                  drag.maximumY: 180
                  drag.minimumX: 0
                  drag.minimumY: 0
                  drag.target: parent
                  onReleased: {
                      console.log("released:" + mouse.x + "," + mouse.y);
                      if(parent.x > 10){ console.log("dragged") }
                  }
              }
          }
      
          TestCase {
              name:"mouserelease"
              when:windowShown
              function test_mouseRelease() {
                  mousePress(container, 0, 0);
                  mouseMove(container, 50, 50);
                  //mouseMove(container, 0, 0);//without this second moveMove, the test will fail
                  compare(container.x, 50);
                  compare(container.y, 50);
              }
          }
      }
      
      

      Attachments

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

        Activity

          People

            charles Charles Yin (closed Nokia identity) (Inactive)
            charles Charles Yin (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes