Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Touch not working in QtWebEngine after opening a DropDown menu

Touch not working in QtWebEngine after opening a DropDown menu

Scheduled Pinned Locked Moved Solved QtWebEngine
qtwebenginetouchscreendrop-down
2 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VannyD
    wrote on last edited by
    #1

    Hello everbody!

    I stumbled across a QtWebEngine problem while using a touch display. I can browse normally through websites via my touch display, but when I click on a DropDown menu (for example on https://www.ebay.com/ clicking on "All categories" next to the search field), touch is not working anymore (or 1/30 touch clicks works). I can still close it via mouse/keyboard. After closing the DropDown menu, touch is working again.

    I created a small example browser, there is nothing special in it:

    BrowserWidget::BrowserWidget(QWidget *parent)
        : QWidget(parent), ui(new Ui::BrowserWidget),
          m_webView(new QWebEngineView(this)), m_page(new QWebEnginePage(this)) {
      ui->setupUi(this);
      ui->verticalLayout->addWidget(m_webView);
    
      m_page->setUrl(QUrl(QStringLiteral("https://www.ebay.com/")));
      m_webView->setPage(m_page);
    
      m_webView->setAttribute(Qt::WA_AcceptTouchEvents);
      m_webView->installEventFilter(this);
    }
    
    bool BrowserWidget::eventFilter(QObject *watched, QEvent *e) {
      qDebug() << "event: " << e->type();
    
      if (e->type() == QEvent::ChildAdded) {
        QChildEvent *ce = static_cast<QChildEvent *>(e);
        if (ce && ce->child()) {
          ce->child()->installEventFilter(this);
        }
      }
    
      return false;
    }
    

    I installed my event filter to the widgets in the QEvent::ChildAdded for a better debugging (so I can observe more events). When I close the DropDown with my mouse I get MouseButtonPress, FocusIn, ChildRemoved, ... events. But with touch I only get MouseButtonPress, nothing more.

    This behaviour is always reproducable and I don't know if I did something wrong, because I can operate the browser via touch. I also added the Qt::WA_AcceptTouchEvents to the child widgets or the BrowserWidget itself, but it didn't make any difference.

    I hope somebody of you can help me out, thank you!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VannyD
      wrote on last edited by
      #2

      It's a QT bug ( https://bugreports.qt.io/browse/QTBUG-79254 )

      If somebody every needs it again I implemented a workaround which I posted here:
      https://stackoverflow.com/questions/62152845/touch-freeze-in-qtwebengine-after-opening-a-dropdown-menu

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved