Kranky077
Kranky077

Reputation: 31

In Qt 5.5 touchscreen-events not working properly for Child dialogs/widgets

I'm facing a very weird issue, I have a running standard desktop application with QMainwindow and certain secondary dialogs and widgets popping up on buttonpress event from QMainwindow.

Recently, I had to run this application on a touch screen system.

Now I'm facing a very weird issue, my touch screen is working on QMainwindow buttons, Radio, checkbox etc, but it is not working on for certain dialogs and it is working for certain other dialogs.

Normally Qt handles Keyboard and Mouse interface(Events) for Interaction with the application and I know application attribute Qt::AA_SynthesizeMouseForUnhandledTouchEvents is set to true by default.

Is this not working properly? is Qt not able to synthesize touch events as Mouse events ?

My system is running on minimal install Ubuntu 16.04 64 bit and Qt 5.5 opensource SDK. I have been breaking my head around this issue for a couple of days with no comprehensive solution. Any Help or any lead is mush appreciated. Thanks !

P.S : I believe this kind of issue is already faced by others

Upvotes: 2

Views: 1563

Answers (1)

Kranky077
Kranky077

Reputation: 31

Finally, I was able to crack this mystery. Actually the thing is QMainwindow or any base Widget of your application is able to properly synthesize the Unhandled touch screen events to Mouse events. So whenever you are creating a dialog/widget, make sure to set Mainwindow as there parent and in the constructor of the child widget use setParent(parent). Worked like a Charm for Me Cheers!

Upvotes: 1

Related Questions