How to switch input language in Qt application?

647 Views Asked by At

I'm writing a simple Qt application for Windows platform. I need to set input language for QPlainTextEdit for it to be non-English by default. How can I do that?

All I could find so far is non-working example:

  QApplication Application(argc, argv);

  QLocale::setDefault(QLocale::German);
  QLocale l;
  qDebug() << l.language();
  Application.inputMethod()->locale().setDefault(QLocale::German);
  qDebug() << Application.inputMethod()->locale().language();
0

There are 0 best solutions below