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

QTouchEventSequence::stationary() doesn't successfully get previous position from previousPoints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 6.0, 6.10.0
    • Testing: qtestlib
    • None

      QTouchEventSequence& QTouchEventSequence::stationary(int touchId)
      {
          auto &p = pointOrPreviousPoint(touchId);
          QMutableEventPoint::setState(p, QEventPoint::State::Stationary);
          return *this;
      }
      
      QEventPoint &QTouchEventSequence::pointOrPreviousPoint(int touchId)
      {
          if (!points.contains(touchId)) {
      qDebug() << "   wasn't there: stashing";
              if (previousPoints.contains(touchId))
                  points[touchId] = previousPoints.value(touchId);
              else
                  points[touchId] = QEventPoint(touchId);
          }
      qDebug() << touchId << points[touchId];
          return points[touchId];
      }
      

      Now if we take tst_HoverHandler::twoHandlersTwoTouches() for example:

          QTest::touchEvent(&window, touchscreen.get()).press(0, pl, &window);
          QTest::touchEvent(&window, touchscreen.get()).stationary(0).press(1, pr, &window);
      

      the "wasn't there: stashing" output occurs when stationary() is called, but not before; and the stationary QEventPoint gets delivered with incorrect global position and negative scene position.

      I can do special things with Stationary points in Qt Quick, and sometimes it's an optimization too: but doing it just to mask problems in QTestlib is kindof silly.

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

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

              Created:
              Updated:

                There are no open Gerrit changes