Gui: fix locale number formatting propagation

This commit is contained in:
0penBrain
2022-03-27 20:50:49 +02:00
committed by wwmayer
parent 650b2f3073
commit eb38017828
3 changed files with 7 additions and 9 deletions

View File

@@ -28,6 +28,7 @@
# include <QRegularExpression>
# include <QStringList>
# include <QTranslator>
# include <QWidget>
#endif
#include <App/Application.h>
@@ -275,9 +276,9 @@ void Translator::setSystemLocale() const
void Translator::updateLocaleChange() const
{
// Need to manually send the event so locale change is fully took into account on widgets
auto ev = QEvent(QEvent::LocaleChange);
qApp->sendEvent(qApp, &ev);
for (auto &topLevelWidget: qApp->topLevelWidgets()) {
topLevelWidget->setLocale(QLocale());
}
}
QStringList Translator::directories() const