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

QTabletEvent TabletMove not sent to a QWidget without any children

    XMLWordPrintable

Details

    • 8fcc92e38 (6.4), 7956d9e06 (dev)

    Description

      For a top level widget without any child widgets, the TabletMove event is not sent. Other events such as TabletPress / TabletRelease are correctly observed. Even if setAttribute(Qt::WA_TabletTracking) is called, it still doesn't work.

      In qwidgetwindow.cpp, QWidgetWindow::handleTabletEvent().

      void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
      {
      static QPointer<QWidget> qt_tablet_target = nullptr;

      QWidget *widget = qt_tablet_target;

      if (!widget) {
      widget = m_widget->childAt(event->pos());
      if (event->type() == QEvent::TabletPress )

      Unknown macro: { if (!widget) widget = m_widget; qt_tablet_target = widget; }

      }

      Given this code, there's a check to see if widget is null, and if so, it checks to see if there's a widget child at the cursor position. In our case, this is no, since there are no child widgets. The next check is to see then if the event type is a TabletPress, which it is not for a TabletMove. Thus for any hovering events in this widget, they are ignored.

      To reproduce the issue, please run the attached example project using a tablet input device.

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              tuomas.vaarala Tuomas Vaarala
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes