mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 12:17:12 +00:00
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
This commit is contained in:
parent
476fc65b0f
commit
9541537e32
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user