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

QEvent::TouchEnd missing from secondly touched widget if released last

    XMLWordPrintable

Details

    Description

      Use application below to reproduce the issue.

      main.cpp
      #include <QApplication>
      #include <QWidget>
      #include <QDebug>
      
      class Widget : public QWidget
      {
        public:
          Widget(QString name)
          {
            setObjectName(name);
            setWindowTitle(name);
            setAttribute(Qt::WA_AcceptTouchEvents);
          }
          virtual bool event(QEvent *event)
          {
            if ( event->type() == QEvent::TouchBegin ) {
              qDebug() << objectName() << "QEvent::TouchBegin";
              event->setAccepted(true);
              return true;
            }
            else if ( event->type() == QEvent::TouchEnd )
              qDebug() << objectName() << "QEvent::TouchEnd";
            else if ( event->type() == QEvent::MouseButtonPress )
              qDebug() << objectName() << "QEvent::MouseButtonPress";
            else if ( event->type() == QEvent::MouseButtonRelease )
              qDebug() << objectName() << "QEvent::MouseButtonRelease";
            return QWidget::event(event);
          }
      };
      
      int main(int argc, char **argv)
      {
        QApplication app(argc, argv);
        Widget w("Widget 1");
        w.show();
        Widget w2("Widget 2");
        w2.show();
        return app.exec();
      }
      
      

      Application creates two separated widgets.
      Position them side by side.
      Press and hold the left window with one finger.
      Press and hold the right window with the second finger.
      In the console window you see that both windows receive a TouchBegin event.
      Now release the left finger and you see also the TouchEnd event.

      The bug comes now: release the right finger and you get NO TouchEnd event!

      Attachments

        1. qtbug34482_diag.patch
          3 kB
        2. qtbug34482.log
          65 kB
        3. qtbug34482.zip
          2 kB
        4. qwindowsmousehandler.zip
          17 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            qtcomsupport Qt Support
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes