Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[[qanda:topic_unsolved]] Open a link in new dialog when left mouse or double clicked from a webengine view.?

$
0
0
@jsulm has already given the right answer. In case anyone arrives at this page and has a similar question but using QML, here is an example of handing the signal in QML: WebEngineView { id: thisWeb anchors.fill: parent url: dlViewModel.targetUrl onNewViewRequested: function (request) { // Any user can trigger newViewRequested by simply holding the CTRL key while clicking any hyperlink. // This forces any attempt at opening a new browser "tab" to open in this one instead: // (tested using qt 5.15 on Linux) // (refer to: https://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html#newViewRequested-signal) request.openIn(thisWeb) } } The following is also a good resource: https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-simplebrowser-example.html ^^ That example uses C++, so it is relevant to @nammi98

Viewing all articles
Browse latest Browse all 13965

Trending Articles