QtCreator uses different environment for run and debug?!?
-
Hi,
I have the problem, that on debugging qtcreator uses different environment so that my application does not know the active locale from user.
This code:
int main(int argc, char *argv[]) { QApplication a(argc, argv); QTranslator translator; const QStringList uiLanguages = QLocale::system().uiLanguages(); for (const QString& locale : uiLanguages) { qDebug() << "got ui-language: >>" << locale << "<<"; } // rest ommited }dumps this messages running application (Ctrl-R):
got ui-language: >> "de" << got ui-language: >> "en-US" <<When I start debugging the same application (F5):
got ui-language: >> "en-US" << got ui-language: >> "en" <<How can I change behaviour of QtCreator?
-
I do not see that behaviour with Qt Creator 6.0.2 and a new project using your code built using Qt 6.3.1 on Linux.
The environment that the each build profile uses when run the application is independent of the others. By default the running process is given the system environment unless you override it in Project Settings. If you override the environment and set LANG or LC_* (on Linux) then the running executable should see that. Make sure you do not have that situation.
-
Hi Chris,
thank you for your attention.
I rechecked all qtcreator versions I have - but before I have to say:
I use linux and I did not change system environment nor did I change environment settings of any qtcreator.Version 5: works as expected (giving de and en)
Version 6, version 7 and version 8 don't give "de", but 2 times "en"All variants started the same way, which means using main menu of kde-desktop.
Do you have any advice, how I could tweak environment of qtcreator 6 and above to use locale setting of current user?
-
Hi Chris,
thank you for your attention.
I rechecked all qtcreator versions I have - but before I have to say:
I use linux and I did not change system environment nor did I change environment settings of any qtcreator.Version 5: works as expected (giving de and en)
Version 6, version 7 and version 8 don't give "de", but 2 times "en"All variants started the same way, which means using main menu of kde-desktop.
Do you have any advice, how I could tweak environment of qtcreator 6 and above to use locale setting of current user?
-
Hi,
just tried running app outside of QtCreator -
yes, the behaviour is identical running from commandline or running through gdb.(Thanks for the hint!)