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

QEvent fails on dynamic_cast to QKeyPressEvent received from QtWebEngine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.9.6, 5.9
    • Core: Event loop, WebEngine
    • None
    • Windows

    Description

      #include "mainwindow.h" 
       #include "ui_mainwindow.h" 
       
       #include <QKeyEvent> 
       #include <QDebug> 
       #include <QtWebEngineWidgets/QtWebEngineWidgets> 
       
       MainWindow::MainWindow(QWidget *parent) : 
           QMainWindow(parent), 
           ui(new Ui::MainWindow) 
       { 
           ui->setupUi(this); 
           QWebEngineView *browser = new QWebEngineView{}; 
       
           setCentralWidget(browser); 
       } 
       
       MainWindow::~MainWindow() 
       { 
           delete ui; 
       } 
       
       bool MainWindow::event(QEvent *event) 
       { 
              QKeyEvent *event1 = dynamic_cast<QKeyEvent*>(event);
              return QMainWindow::event(event); 
       }

      # Start application

      1. Focus on WebEngine
      2. Hold Ctrl button
      3. Failed on red line in code above

      Attachments

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

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            yuriyvashinko Yury Vashinko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes