QInputMethod

Yves Brungard yvesbrungard at orange.fr
Thu Nov 2 17:08:37 GMT 2023


Hello,

I'm trying to get the keyboard layout used by the system.

QInputMethod.locale seems promizing.

However, I do not find any way to use it.

layout = QInputMethod().locale()

gives me PyQt5.QtGui.QInputMethod cannot be instantiated or sub-classed

layout = QInputMethod.locale()

TypeError: locale(self): first argument of unbound method must have type 
'QInputMethod'

How can I give argument of type QInputMethod if I can not instantiate one?

What is the good syntax to use?
Yves





More information about the PyQt mailing list