#include "myapplication.h" MyApplication* app=nullptr; MyApplication::MyApplication(int& argc, char** argv ) : QApplication( argc, argv ) { w=new MainWindow(); connect(w,SIGNAL(germanRequested()),this,SLOT(setGermanLanguage())); w->show(); } MyApplication::~MyApplication() { w->deleteLater(); } void MyApplication::setGermanLanguage() { //this is not working QLocale::setDefault(QLocale::German); QString path=this->applicationDirPath()+"/qtbase_de_De.qm"; t=new QTranslator(this); if(t->load(path)) installTranslator(t); }