From 8c6dcdf8aeda6ff04f41cd3b1e640e0c045eec03 Mon Sep 17 00:00:00 2001 From: woofsauce <46232230+woofsauce@users.noreply.github.com> Date: Wed, 10 May 2023 21:02:18 -0400 Subject: [PATCH] workaround QTBUG-85409 by overwriting default locale QT has some weird behaviour where it would not only attempt to localize the numbers in text hold by certain QT widget, but also doing it wrong for this Chinese numbering format due to a bug. --- CodeX/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CodeX/main.cpp b/CodeX/main.cpp index fbbc6a9..e469e9b 100644 --- a/CodeX/main.cpp +++ b/CodeX/main.cpp @@ -11,6 +11,12 @@ int main(int argc, char *argv[]) QApplication::setOrganizationName("xuanxuan.tech"); QApplication::setApplicationName("CodeX"); QSettings::setDefaultFormat(QSettings::IniFormat); + const QLocale locale = QLocale::system(); + // workaround QTBUG-85409 by overwriting default locale + if (QStringLiteral(u"\u3008") == locale.toString(1)) { + QLocale::setDefault(QLocale::system().name()); + } + CodeX::instance()->show(); return a.exec(); }