From 9541537e32ce220bb6b603ad505217a904d3bf50 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Tue, 7 Oct 2014 14:18:08 +1100 Subject: 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 --- DOCS/client_api_examples/qtexample.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'DOCS') 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 #include #include @@ -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(); -- cgit v1.2.3