From f2dfd1a47bcbf2f979e0feaa02eab12abbce8954 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Thu, 14 Nov 2024 00:47:32 +0100 Subject: [PATCH] Use QDesktopServices on Linux too with Qt 6 Signed-off-by: Matthew J. Milner --- avogadro/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index 92256ba1..1e417800 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -2404,10 +2404,10 @@ void MainWindow::showAboutDialog() void MainWindow::openURL(const QString& url) { -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) || defined(Q_OS_MAC) || defined(Q_OS_WIN) QDesktopServices::openUrl(url); #else - // AppImage can't use QDesktopServices::openUrl, so we use QProcess: + // On Qt5, AppImage can't use QDesktopServices::openUrl, so we use QProcess: QProcess::execute(QString("xdg-open %1").arg(url)); #endif }