summaryrefslogtreecommitdiffstats
path: root/DOCS/client_api_examples/qml_direct/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/client_api_examples/qml_direct/main.cpp')
-rw-r--r--DOCS/client_api_examples/qml_direct/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/DOCS/client_api_examples/qml_direct/main.cpp b/DOCS/client_api_examples/qml_direct/main.cpp
index 03e9f17e84..5f1f1468cf 100644
--- a/DOCS/client_api_examples/qml_direct/main.cpp
+++ b/DOCS/client_api_examples/qml_direct/main.cpp
@@ -1,6 +1,7 @@
#include "main.h"
#include <stdexcept>
+#include <clocale>
#include <QObject>
#include <QtGlobal>
@@ -138,6 +139,10 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
+ // Qt sets the locale in the QGuiApplication constructor, but libmpv
+ // requires the LC_NUMERIC category to be set to "C", so change it back.
+ std::setlocale(LC_NUMERIC, "C");
+
qmlRegisterType<MpvObject>("mpvtest", 1, 0, "MpvObject");
QQuickView view;