QLibraryInfo::location is deprecated since 6.0.
This commit is contained in:
parent
0335bcf571
commit
88a793319e
|
@ -347,4 +347,15 @@ inline auto DropEventPos(const QDropEvent *event) -> QPoint
|
|||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
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
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include <QWidget>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include "../vmisc/compatibility.h"
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
# include <unistd.h>
|
||||
#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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user