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

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.2
    • None
    • 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

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change