PDA

View Full Version : Why QTouchEvent events start working only if I hide and show window?



stephanehamel
26th July 2011, 15:45
Hello,

Maybe someone can tell me why I don't receive any QTouchEvent events in my application until I hide my widgets and show them again.

My top widget is a tab widget. I handle the QTouchEvent in the first tab only.

I have several widgets in the first tab and I create all the widgets at startup. I also set the WA_AcceptTouchEvents recursively to all my widgets in the first tab.

Immediately after startup, I cant get any events in my QTouchEvent handler. But if a go in the second tab and come back in the first tab, I start getting the QTouchEvent as expected and everything works.

It seems that hiding and showing the widgets is triggering something that makes my QTouchEvent flowing as expected.

I also made another experiment with a single shot timer. In the timout event handler I hide the widgets and show them. The QTouchEvent events start working after the timer (I no longer need to switch tab).

Any idea why I observe these issues? Thanks in advance...

high_flyer
28th July 2011, 17:32
Did you overload the touchEevent handler, or did you install eventFilter?
If with eventFilter() where do you set it?