diff options
author | Eike Ziller <[email protected]> | 2021-08-11 15:37:13 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2021-11-05 09:10:15 +0000 |
commit | b7853efaf3a3e2d6b6ae0c77ddd886934b1ba234 (patch) | |
tree | f1165a0803c1020c4f58a83654c4ffae95801547 /src/plugins/help/webenginehelpviewer.cpp | |
parent | 083c8029b0c160759238de3d4b24284dfc16cb19 (diff) |
Re-enable QWebEngine help viewer backend for Qt 6.2
Fixes: QTCREATORBUG-26380
Change-Id: I8aa31bebd5a8a20f664a17bca2f657fcfac4b1f5
Reviewed-by: Tim Jenssen <[email protected]>
Diffstat (limited to 'src/plugins/help/webenginehelpviewer.cpp')
-rw-r--r-- | src/plugins/help/webenginehelpviewer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/help/webenginehelpviewer.cpp b/src/plugins/help/webenginehelpviewer.cpp index 65d80c4d30c..7ece25833ff 100644 --- a/src/plugins/help/webenginehelpviewer.cpp +++ b/src/plugins/help/webenginehelpviewer.cpp @@ -37,7 +37,11 @@ #include <QDesktopServices> #include <QTimer> #include <QVBoxLayout> +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) +#include <QWebEngineContextMenuRequest> +#else #include <QWebEngineContextMenuData> +#endif #include <QWebEngineHistory> #include <QWebEngineProfile> #include <QWebEngineSettings> @@ -335,7 +339,11 @@ bool WebView::eventFilter(QObject *src, QEvent *e) void WebView::contextMenuEvent(QContextMenuEvent *event) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + QMenu *menu = createStandardContextMenu(); +#else QMenu *menu = page()->createStandardContextMenu(); +#endif // insert Open as New Page etc if OpenLinkInThisWindow is also there const QList<QAction*> actions = menu->actions(); auto it = std::find(actions.cbegin(), actions.cend(), @@ -344,7 +352,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // insert after ++it; QAction *before = (it == actions.cend() ? 0 : *it); +#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) + QUrl url = lastContextMenuRequest()->linkUrl(); +#else QUrl url = page()->contextMenuData().linkUrl(); +#endif if (m_viewer->isActionVisible(HelpViewer::Action::NewPage)) { auto openLink = new QAction(QCoreApplication::translate("HelpViewer", Constants::TR_OPEN_LINK_AS_NEW_PAGE), menu); |