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

winId() return wrong hwnd when window contains a QWebEngine widget

    XMLWordPrintable

Details

    • Windows

    Description

      To reproduce:

       

      #include <QtWebEngineWidgets/QWebEngineView>
       
      MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) 
      {
             ui.setupUi(this);
             QWebEngineView* engine = new QWebEngineView(this);
      
             HWND hwnd = (HWND)this->winId();
             qDebug() << "\nhwnd: " << hwnd << "\n";
      }
      

      The hwnd returned by windId() isn't the same of the main window.

      When i search for any window which the given id nothing is found, which means the window doesnt exist anymore.

       

      Commenting the line QWebEngineView* engine = new QWebEngineView(this); it does return the hwnd of the main window correctly.

       

      Im not sure if this can be called a bug, but how i can know the main window hwnd in this case?

       

       

      Attachments

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            cesa caio cesar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: