From 504bed284d17f2641c7c21200442a9dba3d786de Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 21 Feb 2024 10:40:02 +0100 Subject: [PATCH] Axivion: Allow opening external links ..outside of Qt Creator, by using the default browser or similar. Change-Id: Ibaa379d2a26976fe717ee38b056794dd54838685 Reviewed-by: hjk --- src/plugins/axivion/axivionplugin.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/plugins/axivion/axivionplugin.cpp b/src/plugins/axivion/axivionplugin.cpp index 9f142a17671..a5da9cdba2c 100644 --- a/src/plugins/axivion/axivionplugin.cpp +++ b/src/plugins/axivion/axivionplugin.cpp @@ -34,12 +34,14 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -838,6 +840,19 @@ void AxivionPluginPrivate::handleAnchorClicked(const QUrl &url) { QTC_ASSERT(dd, return); QTC_ASSERT(dd->m_project, return); + if (!url.scheme().isEmpty()) { + const QString detail = Tr::tr("The activated link appears to be external.\n" + "Do you want to open \"%1\" with its default application?") + .arg(url.toString()); + const QMessageBox::StandardButton pressed + = CheckableMessageBox::question(Core::ICore::dialogParent(), + Tr::tr("Open External Links"), + detail, + Key("AxivionOpenExternalLinks")); + if (pressed == QMessageBox::Yes) + QDesktopServices::openUrl(url); + return; + } const QUrlQuery query(url); if (query.isEmpty()) return;