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

WheelHandler only reacts to one wheel event between mouse moves

    XMLWordPrintable

    Details

    • Commits:
      262d7eb305e1dea8dac660bec3ccc50193258ea9 (qt/qtdeclarative/dev)

      Description

      Easy to see with qtdeclarative/tests/manual/pointer/pinchAndWheel.qml for example: you're supposed to be able to spin the mouse wheel to zoom in and out, but it will only work once, until you move the mouse. The reason is here:

      bool QQuickItemPrivate::handlePointerEvent(QPointerEvent *event, bool avoidExclusiveGrabber)
      {
          bool delivered = false;
          if (extra.isAllocated()) {
              for (QQuickPointerHandler *handler : extra->pointerHandlers) {
                  bool avoidThisHandler = false;
                  if (avoidExclusiveGrabber) {
                      for (auto &p : event->points()) {
                          if (event->exclusiveGrabber(p) == handler) {
                              avoidThisHandler = true;
                              break;
                          }
                      }
                  }
      if (!avoidThisHandler && QQuickPointerHandlerPrivate::deviceDeliveryTargets(event->device()).contains(handler))
      qDebug() << "avoiding" << handler << "because it's in deviceDeliveryTargets" << event;
                  if (!avoidThisHandler &&
                          !QQuickPointerHandlerPrivate::deviceDeliveryTargets(event->device()).contains(handler)) {
                      handler->handlePointerEvent(event);
                      delivered = true;
                  }
              }
          }
          return delivered;
      }
      

      QQuickWindowPrivate::deliverPointerEvent() clears deviceDeliveryTargets but QQuickWindowPrivate::deliverSinglePointEventUntilAccepted() does not.

        Attachments

        For Gerrit Dashboard: QTBUG-88428
        # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes