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

it's not useful that defaultMouseDelay() in QTestLib is 0 by default

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8
    • Testing: qtestlib
    • None

      IMO we should just change it to be 1 or some such small value. The reasons are:

      1. nobody can interact with the mouse in zero time, so pretending that it can happen is unrealistic
      2. there's no API for a test class to change the default delay wholesale: only the QTEST_MOUSEEVENT_DELAY environment variable, and the ability to set a specific delay (timestamp delta) on a specific event
      3. we use timestamp deltas to calculate velocity of movement
      4. we need to add support for delaying touch events and other kinds of events, and I don't want to repeat this mistake
      5. the missing features and misfeatures in testlib result in needing to write better test functions in qtdeclarative as workarounds

      And BTW this delay should never be used to drive an actual qWait(). Tests can run faster if we generate events at full speed and fake the timestamps to simulate things that take time (like testing double-clicks, or waiting long enough to avoid a double-click). That in turn results in the caveat that some tests may need to be adjusted to wait for the UI to react to events that are occurring faster than real-time. But since we've been trying to minimize use of qWait() for a long time already, hopefully there are few such cases left, if any.

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

            macadder Jason McDonald
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes