PDA

View Full Version : Qt stealing events



rmwatson
9th December 2010, 00:31
Hello, I am having a bit of a problem with Qt runing via PyQt4's python bindings under an embedded python interpreter in a graphics application. The problem is that whenever a QObject is instanced, Preassure events from my Wacom tablet dont get through to the host graphics application. It basically treats the Tablet input as a mouse, clicked/not clicked.

What is odd is as soon as I delete the QObject I have instanced, the preassure events resume in the host application. Now even if say a QDialog is instanced, but never shown. as long as any QObject or derived class intance,exists in memory - I have this problem. I was hoping someone might be able to shed some light on this issue before i dig through the Qt Source code - Thanks

high_flyer
9th December 2010, 10:51
Qt is reacting to the event sent by the underlying windowing system which probably is sending the zablet as mouse events.
What you can do in your QObject is ignore the events, they will then propagate further.

rmwatson
21st December 2010, 15:08
Just to follow up this post. It seems that as soon as I have instanced and shown any GUI element, I get this behavior. Instancing a QApplication and a QDialog is fine, as soon as a show my QDialog instance, even after it has been destroyed, something has triggered in the QApplication that means my wacom tablet events are no longer recieved with preassure sensitivity in the host application.

The only way I have got around this problem is to totally destroy the QApplication after every dialog is closed. This of course means I cant have a dialog open if i want to paint in the host app.

Any ideas ?

I ahve tried sticking an event filter on the QApp and the QDialog and ignoring all events. still the same behavior

rmwatson
22nd December 2010, 11:14
I came across this post which seems to be the issue I am talking about.

http://bugreports.qt.nokia.com/browse/QTBUG-6257