diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2014-10-07 14:18:08 +1100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-07 08:45:48 +0200 |
commit | 9541537e32ce220bb6b603ad505217a904d3bf50 (patch) | |
tree | edefc7242f6d83453852f4c6d8e19aeebc49a920 | |
parent | 476fc65b0fda4fed099ee31b04b926d27e9a5f28 (diff) | |
download | mpv-9541537e32ce220bb6b603ad505217a904d3bf50.tar.bz2 mpv-9541537e32ce220bb6b603ad505217a904d3bf50.tar.xz |
DOCS/client_api_examples: qtexample: set the locale
QApplication sets the locale, so change the LC_NUMERIC category back to
"C" for libmpv.
See: http://qt-project.org/doc/qt-5/qcoreapplication.html#locale-settings
-rw-r--r-- | DOCS/client_api_examples/qtexample.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/DOCS/client_api_examples/qtexample.cpp b/DOCS/client_api_examples/qtexample.cpp index 2740bd9f67..5ebc788c64 100644 --- a/DOCS/client_api_examples/qtexample.cpp +++ b/DOCS/client_api_examples/qtexample.cpp @@ -2,6 +2,7 @@ // This example can be built with: qmake && make +#include <clocale> #include <sstream> #include <QFileDialog> @@ -152,6 +153,11 @@ MainWindow::~MainWindow() int main(int argc, char *argv[]) { QApplication a(argc, argv); + + // Qt sets the locale in the QApplication constructor, but libmpv requires + // the LC_NUMERIC category to be set to "C", so change it back. + std::setlocale(LC_NUMERIC, "C"); + MainWindow w; w.show(); |