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

TouchUpdate not fired when the second finger is lifted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 5.3.2
    • None
    • Compile platform:
      Windows 8.1 64bit – Qt Creator 3.2.2 – Qt 5.3.2

      Deploy platform:
      Android 4.3 (Samsung Galaxy S III)
    • Android

    Description

      The QTouchEvent works perfectly with only one finger, with two fingers it works nearly as expected, i mean i receive a second TouchUpdate when i put the second finger on the screen. After i lift one of the two finger off the screen i get no TouchUpdate.

      Minimum Compilable Example:

      • mainwindow.h
      #ifndef MAINWINDOW_H
      #define MAINWINDOW_H
      
      #include <QMainWindow>
      
      namespace Ui {
      class MainWindow;
      }
      
      class MainWindow : public QMainWindow
      {
          Q_OBJECT
      
      public:
          explicit MainWindow(QWidget *parent = 0);
          ~MainWindow();
      
      protected slots:
          bool event(QEvent *event);
      
      private:
          Ui::MainWindow *ui;
      };
      
      #endif // MAINWINDOW_H
      
      • mainwindow.cpp
      #include "mainwindow.h"
      #include "ui_mainwindow.h"
      
      #include <QTouchEvent>
      #include <QEvent>
      #include <QDebug>
      
      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent),
          ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          QWidget::setAttribute(Qt::WA_AcceptTouchEvents);
          QWidget::setAttribute(Qt::WA_StaticContents);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      bool MainWindow::event(QEvent *event)
      {
        qDebug() << event->type();
        switch(event->type())
        {
      
        case QEvent::TouchBegin:
        {
      
          QTouchEvent *te = static_cast <QTouchEvent *>(event);
          int x = te->touchPoints().size();
          qDebug() << x;
      
        }
        break;
      
        case QEvent::TouchUpdate:
        {
      
           QTouchEvent *te = static_cast <QTouchEvent *>(event);
           int x = te->touchPoints().size();
           qDebug() << x;
      
        }
        break;
      
        case QEvent::TouchEnd:
        {
      
          QTouchEvent *te = static_cast <QTouchEvent *>(event);
          int x = te->touchPoints().size();
          qDebug() << x;
      
        }
        break;
      
        default:
            return true;
      
      
        }
        return true;
      }
      

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            marco76 Marco Leopardi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes