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

Example for TouchEventSequence in TestCase Qml needs some correction

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.13
    • 5.13
    • Documentation
    • None
    • 3dde49e3e0278e2aaea7b255bc35a372c43fa0ac

    Description

      In the example given for TouchEventSequence at https://doc.qt.io/qt-5/qml-qttest-testcase.html#touchEvent-method, a correction is needed in 'when' property of TestCase{ }. Like TestCase should be executed when the window is shown meaning it is ready for touch actions.

      Rectangle {
          width: 640; height: 480
      
          MultiPointTouchArea {
              id: area
              anchors.fill: parent
              property bool touched: false
              onPressed: touched = true
          }
      
          TestCase {
              name: "ItemTests"
             //  when: area.pressed  ---> Should be changed to windowShown
             when: windowShown
              id: test1
      
              function test_touch() {
                  var touch = touchEvent(area);
                  touch.press(0, area, 10, 10);
                  touch.commit();
                  verify(area.touched);
              }
          }
      }
      

      Attachments

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

        Activity

          People

            vertries Nico Vertriest (Inactive)
            shmittal Shveta Mittal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes