Skip to content
Permalink
Browse files
Also load qtbase translations (QDialogButtonBox buttons etc)
  • Loading branch information
manisandro authored and nyalldawson committed Jun 21, 2021
1 parent a29ce54 commit d5c38907fc33a1b53205e94fe67f4197ee6fc579
Showing with 12 additions and 0 deletions.
  1. +11 −0 src/core/qgsapplication.cpp
  2. +1 −0 src/core/qgsapplication.h
@@ -206,6 +206,16 @@ QgsApplication::QgsApplication( int &argc, char **argv, bool GUIenabled, const Q
{
QgsDebugMsgLevel( QStringLiteral( "loading of qt translation failed %1/qt_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ), 2 );
}

mQtBaseTranslator = new QTranslator();
if ( mQtBaseTranslator->load( QStringLiteral( "qtbase_" ) + *sTranslation(), QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ) )
{
installTranslator( mQtBaseTranslator );
}
else
{
QgsDebugMsg( QStringLiteral( "loading of qtbase translation failed %1/qtbase_%2" ).arg( QLibraryInfo::location( QLibraryInfo::TranslationsPath ), *sTranslation() ) );
}
}

mApplicationMembers = new ApplicationMembers();
@@ -417,6 +427,7 @@ QgsApplication::~QgsApplication()
delete mApplicationMembers;
delete mQgisTranslator;
delete mQtTranslator;
delete mQtBaseTranslator;

// we do this here as well as in exitQgis() -- it's safe to call as often as we want,
// and there's just a *chance* that someone hasn't properly called exitQgis prior to
@@ -1018,6 +1018,7 @@ class CORE_EXPORT QgsApplication : public QApplication

QTranslator *mQgisTranslator = nullptr;
QTranslator *mQtTranslator = nullptr;
QTranslator *mQtBaseTranslator = nullptr;

QgsDataItemProviderRegistry *mDataItemProviderRegistry = nullptr;
QgsAuthManager *mAuthManager = nullptr;

0 comments on commit d5c3890

Please sign in to comment.