I have several issues:
I tried this first:
bool MyWindow::event(QEvent* e)
{
if (e->type() == QEvent::KeyboardLayoutChange)
qDebug() << "Keyboard Layout Changed";
return QWidget::event(e);
}
But this type of event is never passed. Also, I have no idea how to solve the other 2 issues.
Could you please show me any workable example on the latest Qt version or some other cross-platform solutions of this problem?
Qt 5.0.2
Windows 7 Visual Studio 2012
Ubuntu 12.04 G++ 4.7.0
There is no cross-platform solution to get the keyboard language or to change its layout from within Qt. You'll need platform-specific solutions: one for Windows, one for X11. In the future you'd need Wayland as well, I'd presume.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With