diff options
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/client_api_examples/qml/main.cpp | 5 | ||||
-rw-r--r-- | DOCS/client_api_examples/qml_direct/main.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/DOCS/client_api_examples/qml/main.cpp b/DOCS/client_api_examples/qml/main.cpp index 2794d87c1a..69552e982c 100644 --- a/DOCS/client_api_examples/qml/main.cpp +++ b/DOCS/client_api_examples/qml/main.cpp @@ -1,6 +1,7 @@ #include "main.h" #include <stdexcept> +#include <clocale> #include <QObject> #include <QtGlobal> @@ -121,6 +122,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; 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; |