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

Example for TouchEventSequence in TestCase Qml needs some correction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.13
    • Fix Version/s: 5.13
    • Component/s: Documentation
    • Labels:
      None
    • Commits:
      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

            Assignee:
            vertries Nico Vertriest (Inactive)
            Reporter:
            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