[PyKDE] Newbie question on QWidget.focusOutEvent

Hans-Peter Jansen hpj at urpla.net
Fri Sep 23 15:33:19 BST 2005


Am Freitag, 23. September 2005 10:12 schrieb Giovanni Bajo:
> Volker Lenhardt <volker.lenhardt at uni-due.de> wrote:
> > But I don't get it to work. I try to open a message box on focus
> > change, but it never comes. Focus changes undisturbed. A snippet of
> > my script:
>
> Are you sure you are giving focus to the Combo box? Use the TAB key
> to give it real focus. If you check, QComboBox' focus policy is
> KeyFocus, so it only gets the focus through key presses, *not* mouse
> actions. If you want to change this, use
> setFocusPolicy(QWidget.StrongFocus) so that it can get the focus
> through either mouse or keyboard.

If that is not your problem, it could be related to an Qt issue with 
container widgets, where the container widget itself will never receive 
certain events, but the embedded widgets (QEditLine) in this case.
A workaround is to install an event filter on those widgets (and on the 
possibly involved proxy widgets), and handle the events, you need in 
the eventFilter() method.

If you cannot follow me, just call back, and I will post some code 
fragments.

Pete




More information about the PyQt mailing list