Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
6.4.0
-
None
-
Windows 10, Qt 6.4, Visual Studio 2022
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?