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

QScroller with QScroller::TouchGesture does not cause widgets to ignore synthesized mouse events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 10 ver 1709 x64
       * MSVC2017 x64, Qt 5.9.2
       * Self-built Qt 5.9.2 with mingw-w64 x64

      Description

      When using `QScroller::grabGesture(widget, QScroller::TouchGesture)`, the widget captures the touch gestures but the system synthesized mouse events aren't ignored by the widget. This can cause some weird behaviours for certain widgets.

      Using `QScroller::grabGesture(widget, QScroller::LeftMouseButtonGesture)` produces the expected result.

      To reproduce:

      1. Use Pixelator example https://doc.qt.io/qt-5/qtwidgets-itemviews-pixelator-example.html as base
      2. In `mainwindow.cpp`, add `#include <QScroller>` to the top, and the following at the end of `MainWindow::MainWindow()`:
      view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
      view->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
      QScroller::grabGesture(view, QScroller::TouchGesture);
      1. Build and run program
      2. Use touchscreen to scroll the `QTableView` by dragging inside it, notice that some of the cells gets selected, also there may be some jumping due to bugged autoscroll
      3. Change `QScroller::TouchGesture` to `QScroller::LeftMouseButtonGesture`, rebuild and run program
      4. Use touchscreen to scroll the `QTableView` by dragging inside it, notice that the cells doesn't get selected. Same with mouse dragging.

        Attachments

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

          Activity

            People

            Assignee:
            richard Richard Moe Gustavsen
            Reporter:
            alvinhochun Alvin Wong
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes