Saturday, August 17, 2013

Python Pyside - prevent widget from grabbing the focus

Python Pyside - prevent widget from grabbing the focus

I'm creating a virtual keyboard for a PySide application. The problem is
when a user clicks on the virtual keyboard widget, the widget being edited
(for example a QLineEdit) loses focus and the keyboard grabs the focus.
how can i prevent this? i tried listening the events on the virtual
keyboard and filtering QtCore.QEvent.MouseButtonPress,
QtCore.QEvent.MouseButtonRelease, QtCore.QEvent.KeyPress,
QtCore.QEvent.KeyRelease, QtCore.QEvent.WindowActivate and
QtCore.QEvent.FocusIn, it did not work.
I'm using python 3.3 and pyside 1.1.2

No comments:

Post a Comment