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

Assert failure on qwebenginepage.cpp when context menu event handled on event filter

    XMLWordPrintable

Details

    Description

      Q_ASSERT on qwebenginepage.cpp fails when the QEvent::ContextMenu event is handled on the event filter.

      Example code from the event filter that consumes QEvent::ContextMenu (full example code attached):

          bool eventFilter(QObject* watched, QEvent* event)
          {
              QWebEngineView* view = qobject_cast<QWebEngineView*>(watched);
      
              if (view) {
                  if (event->type() == QEvent::ContextMenu) {
                      qDebug()<< "Do something for QEvent::ContextMenu.";
                      return true;
                  }
      

      Attached example application demonstrates the use case (event filter is found from mainwindow.h):

      • run the example on debug mode and press the right mouse key --> ASSERT failure:
        Starting D:\mycases\build-bser-Desktop_Qt_5_5_1_MSVC2013_64bit-Debug\debug\bser.exe...
        Do something for QEvent::ContextMenu.
        ASSERT: "view->d_func()->m_pendingContextMenuEvent" in file api\qwebenginepage.cpp, line 728
        

      Attachments

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

        Activity

          People

            mibrunin Michael Bruning
            tarjasundqvist Tarja Sundqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes