[Interest] How can I block the WindowActivate and FocusIn events when showing window programmatically

Bo Thorsen bo at vikingsoft.eu
Fri Oct 31 09:01:03 CET 2014


Den 30-10-2014 20:30, Yili Pan skrev:
> Hi:
>
> We want to block the widget's WindowActivate and FocusIn event 
> triggered by calling its show() function, with Qt4,  we used to do 
> that by setting flag before and after show() and filter out the event 
> in eventfilter based on the flag.  But with Qt5, the events are 
> processed asynchronously, we cannot block the event in the same way 
> anymore.
>
> Any ideas how I can identify those events that are caused by calling 
> QWdiget::show() and filter them out?

You can use an event filter for this. Take a look at the documentation 
for QObject::installEventFilter, it should be simple to follow.

Bo.

-- 
Viking Software
Qt and C++ developers for hire
http://www.vikingsoft.eu




More information about the Interest mailing list