Skip to content

Commit ad73447

Browse files
committed
qt6: Do not use deprecated QLibraryInfo::path in Qt 6
See https://doc.qt.io/qt-6/qtcore-changes-qt6.html#other-classes
1 parent 3f51d0b commit ad73447

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/qt/bitcoin.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,17 @@ static void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTrans
139139
// - First load the translator for the base language, without territory
140140
// - Then load the more specific locale translator
141141

142+
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
143+
const QString translation_path{QLibraryInfo::location(QLibraryInfo::TranslationsPath)};
144+
#else
145+
const QString translation_path{QLibraryInfo::path(QLibraryInfo::TranslationsPath)};
146+
#endif
142147
// Load e.g. qt_de.qm
143-
if (qtTranslatorBase.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
148+
if (qtTranslatorBase.load("qt_" + lang, translation_path))
144149
QApplication::installTranslator(&qtTranslatorBase);
145150

146151
// Load e.g. qt_de_DE.qm
147-
if (qtTranslator.load("qt_" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
152+
if (qtTranslator.load("qt_" + lang_territory, translation_path))
148153
QApplication::installTranslator(&qtTranslator);
149154

150155
// Load e.g. bitcoin_de.qm (shortcut "de" needs to be defined in bitcoin.qrc)

0 commit comments

Comments
 (0)