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

Touch events inside QGraphicsWebView aren't recognised properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.2.0 Beta1
    • WebKit
    • Windows 8 with touch screen

      Clicking on the links on the opened webpage gives ui feedback that the touch event has gone through but the link isn't followed.
      If the link is clicked with two fingers it's followed.

      This might be related to issue https://bugreports.qt-project.org/browse/QTBUG-31938

      main.cpp
      #include <QApplication>
      #include <QGraphicsScene>
      #include <QGraphicsView>
      #include <QGraphicsWebView>
      #include <QGLWidget>
      #include <QMainWindow>
      #include <QFileInfo>
      #include <QDir>
      #include <qdebug.h>
      #include <QWebView>
      #include <QTouchEvent>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QMainWindow *mMainWindow = new QMainWindow();
          mMainWindow->setWindowTitle("TouchEvent");
          mMainWindow->showMaximized();
      
      	
      
          QGraphicsScene* mGraphicsScene = new QGraphicsScene(mMainWindow);
      
          QGraphicsView* mGraphicsView = new QGraphicsView(mGraphicsScene);
      
          QBrush brush;
          brush.setColor(Qt::red);
          mGraphicsView->setBackgroundBrush(brush);
      
          mGraphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
          mGraphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      
          mGraphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
          mGraphicsView->setViewport(new QGLWidget(mMainWindow));
       
          QGraphicsWebView* mGraphicsWebView = new QGraphicsWebView();
      
      	mMainWindow->setAttribute(Qt::WA_AcceptTouchEvents);
      	mGraphicsWebView->setAcceptTouchEvents(true);
      	
      	mGraphicsWebView->show();
      	
      	mGraphicsWebView->setUrl(QUrl("http://www.google.com"));
      	
      	mGraphicsScene->addItem(mGraphicsWebView);
      
          mMainWindow->setCentralWidget(mGraphicsView);
      	
          mMainWindow->show();
      
          return app.exec();
      }
      

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

            allan.jensen Allan Sandfeld Jensen
            kileppal Kimmo Leppälä
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes