Hi Bo:

Thank you for the reply!

I do not want to filter out all the WindowActivate or FocusIn event tough,
only these are triggered by calling QWidget::show(). But because the events
are processed asynchronously in Qt5, when I catch them in the eventfilter,
I don't know whether they are originated from calling show() or they
are spontaneous
event caused by manual interaction. I also tried to filter out the event by
telling whether they are spontaneous, but unfortunately no matter where
they originate from, they are spontaneous (could this be a bug??). Any
thoughts or suggestion :)

Thank you!

-Yili

On Fri, Oct 31, 2014 at 4:01 AM, Bo Thorsen <b...@vikingsoft.eu> wrote:

> 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
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to