Tom Schindl wrote:
> Is this better than installing an event-filter on the widget itself?
> I guess the best (from a performance point of view) would be to subclass
> widgets and handle it there.
>   

Listening to the focusChanged signal will give you better performance 
than installing an event filter on all your widgets. You will get extra 
overhead for each event filter you install.

> Is there a reason a QWidget doesn't has a focusChanged-signal? I also
> need to track the mouse-enter and mouse-exit which I'm currently doing
> also in the installed event-filter.
>   


The focusChanged signal is global for the entire application (it's 
emitted whenever any widget belonging to the application gains or loses 
focus) so it doesn't really make sense to have a focusChanged signal 
particular to the widget itself (and performance would decline if we did 
this.) The widget itself could of course have a signal emitting whenever 
it gains focus. The reason it doesn't, I assume, is that it doesn't 
represent the more common use case, and we try to favor speed, 
simplicity and consistency over completeness whenever it is correct to 
do so. Specific events in Qt Jambi are handled through virtual callbacks 
as a rule, not signals. Hope that answers your question!

-- Eskil
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to