qDebug() << QLocale::languageToString(QLocale::system().language());qDebug() << QLocale::languageToString(QApplication::keyboardInputLocale ().language());
C++ (Qt)#include <QtCore>#include <QtGui> int main(int argc, char* argv[]){ QApplication app(argc, argv); QDialog *dialog = new QDialog; QLabel *label = new QLabel(dialog); QString *str = new QString(); *str = app.keyboardInputLocale().name(); label->setText(*str); dialog->show(); return app.exec();}
C++ (Qt)#ifdef Q_WS_WIN int i = (int)GetKeyboardLayout(GetCurrentThreadId()); if(i == 68748313) //Russian //do smth else if(i == 67699721) //English //do smth else if(i == 69338146) //Ukrainian //do smth else //unknown language#endif