diff --git a/src/libs/vmisc/compatibility.h b/src/libs/vmisc/compatibility.h index e9c132b81..44f00d850 100644 --- a/src/libs/vmisc/compatibility.h +++ b/src/libs/vmisc/compatibility.h @@ -347,4 +347,15 @@ inline auto DropEventPos(const QDropEvent *event) -> QPoint #endif } +//--------------------------------------------------------------------------------------------------------------------- +template +inline auto QLibraryPath(T loc) -> QString +{ +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return QLibraryInfo::path(loc); +#else + return QLibraryInfo::location(loc); +#endif +} + #endif // COMPATIBILITY_H diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 46a756c0f..c46ca905d 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -39,6 +39,8 @@ #include #include +#include "../vmisc/compatibility.h" + #ifdef Q_OS_UNIX # include #endif @@ -260,7 +262,7 @@ void VAbstractApplication::LoadTranslation(QString locale) #if defined(Q_OS_WIN) || defined(Q_OS_MAC) const QString qtQmDir = appQmDir; #else - const QString qtQmDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + const QString qtQmDir = QLibraryPath(QLibraryInfo::TranslationsPath); #endif LoadQM(qtTranslator, QStringLiteral("qt_"), locale, qtQmDir); installTranslator(qtTranslator);