QWebEngine open links issue
-
@Cobra91151 My guess is that you're missing OpenSSL
wrote on 9 Aug 2018, 10:59 last edited byHi! What do you mean by missing
OpenSSL
? -
Hi! What do you mean by missing
OpenSSL
?@Cobra91151 You're trying to access HTTPS URLs which are encrypted.
-
@Cobra91151 You're trying to access HTTPS URLs which are encrypted.
wrote on 9 Aug 2018, 11:05 last edited byIf
OpenSSL
is missing when why theFollow link
in the context menu works? How to get the access to the source code of theQWebEngine
context menu? -
If
OpenSSL
is missing when why theFollow link
in the context menu works? How to get the access to the source code of theQWebEngine
context menu? -
wrote on 9 Aug 2018, 11:09 last edited by
Ok. Thanks. I think the problem is with tabs. These links will open in the new tabs, but I need to open it in the same tab.
-
wrote on 9 Aug 2018, 13:16 last edited by
I have found that the issue is with links that have
target="_blank"
properties. So, I should reimplementQWebEnginePage
createWindow
method to open such links in the same window. -
I have found that the issue is with links that have
target="_blank"
properties. So, I should reimplementQWebEnginePage
createWindow
method to open such links in the same window.wrote on 9 Aug 2018, 13:22 last edited by@Cobra91151
target="_blank"
links means open in new window/tab, so why would you want to (re-)implement to open in same window? If anything you need to change the link? -
@Cobra91151
target="_blank"
links means open in new window/tab, so why would you want to (re-)implement to open in same window? If anything you need to change the link?wrote on 9 Aug 2018, 13:33 last edited by Cobra91151 8 Sept 2018, 13:33I know what
target="_blank"
means, I illustrated it for testing purposes. The problem is withQWebEngine
doesn't work with it well, and do nothing when clicking on such link. How can I change such links for every website on the web? -
wrote on 9 Aug 2018, 14:09 last edited by
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. -
wrote on 28 Feb 2019, 07:56 last edited by
Cobra91151 I'm also facing the same problem in Python and PyQt5. How to solve this problem in Python?