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

figure out how to get Wacom tablet proximity position; deliver to window

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5
    • None

    Description

      This feature has always been missing. Last time I looked, it seemed that we would need to wait for the tablet move event that comes after the proximity-enter, because the position info (etc) is missing from the proximity-enter event itself. And so, we've never been able to deliver TabletEnterProximity events to the appropriate QWindow: you have to subclass Q(Gui)Application to get the events (as in qtbase/examples/widgets/widgets/tablet/tabletapplication.cpp) or install an event filter (as in qtbase/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp).

      While we're at it, we can add whatever else we can get, and remove as many Q_UNUSED as possible from this:

      bool QWindowSystemInterface::handleTabletEnterLeaveProximityEvent(QWindow *window, ulong timestamp, const QPointingDevice *device,
                                                                        bool inProximity, const QPointF &local, const QPointF &global,
                                                                        Qt::MouseButtons buttons, int xTilt, int yTilt,
                                                                        qreal tangentialPressure, qreal rotation, int z,
                                                                        Qt::KeyboardModifiers modifiers)
      {
          Q_UNUSED(window);
          Q_UNUSED(local);
          Q_UNUSED(global);
          Q_UNUSED(buttons);
          Q_UNUSED(xTilt);
          Q_UNUSED(yTilt);
          Q_UNUSED(tangentialPressure);
          Q_UNUSED(rotation);
          Q_UNUSED(z);
          Q_UNUSED(modifiers);
          return inProximity
              ? handleWindowSystemEvent<QWindowSystemInterfacePrivate::TabletEnterProximityEvent>(timestamp, device)
              : handleWindowSystemEvent<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent>(timestamp, device);
      }
      
          class TabletEnterProximityEvent : public PointerEvent {
          public:
              // TODO store more info: position and whatever else we can get on most platforms
              TabletEnterProximityEvent(ulong time, const QPointingDevice *device)
                  : PointerEvent(nullptr, time, TabletEnterProximity, Qt::NoModifier, device) { }
          };
      
          class TabletLeaveProximityEvent : public PointerEvent {
          public:
              // TODO store more info: position and whatever else we can get on most platforms
              TabletLeaveProximityEvent(ulong time, const QPointingDevice *device)
                  : PointerEvent(nullptr, time, TabletLeaveProximity, Qt::NoModifier, device) { }
          };
      

      If we can deliver the proximity events to the window, it will be much easier to make use of them in Qt Quick.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated: