The browser does not follow some links
Unsolved
General and Desktop
-
@Mikeeeeee said in The browser does not follow some links:
How to fix ?
make sure it follows every link...
-
@Mikeeeeee
3 words:rubber duck debugging
-
I seem to have that problem. The author make it so:
I have fixed it by reimplementing QWebEnginePage.appwebenginepage.cpp
QWebEnginePage *AppWebEnginePage::createWindow(QWebEnginePage::WebWindowType) { return this; }
And added the page to the QWebEngineView.
browserTest = new QWebEngineView(browserTab); AppWebEnginePage *webPage = new AppWebEnginePage(); browserTest->setPage(webPage); Now it opens all links in the QWebEngineView window.
But I didn't know how to do it. Please explain.
-
Hi
You should create your own version of a QWebEnginePage
In his sample its called AppWebEnginePageand in that new class, you should override the virtual function
https://doc.qt.io/qt-5/qwebenginepage.html#createWindow
as shown.and then add your page to the Engine. (instead)