[Qt-interest] QGraphicsScene and multitouch events

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Thu Jan 6 10:29:02 CET 2011


On 2011-01-05 Sean Sean Hayes wrote:

> Oliver,
> 
> I am not sure what the problem could be. Maybe you could include your
> code or post it to the forum thread. 

I saw on that Qt Forum (or was it Qt Centre? ;) posting from you that you have working code. But I think you tried successfully with Qt 4.6.x

Are you saying that your code from back then is still working (on Windows 7 or whatever platform you were testing)? That would at least indicate whether it is really a platform (Mac) issue or a regression from Qt 4.6 to 4.7.

I didn't have time yet to come up with a simple QGraphicsScene/QGraphicsObject example which would demonstrate the "QGraphicsObject not receiving Gesture events" issue.


However, I do have a fully compileable example attached to http://bugreports.qt.nokia.com/browse/QTBUG-16281 which shows another odity, namely that "Pan Gestures" are "swallowed" by QGraphicsItem (note: not QGraphicsObject) when the mouse hovers over them. The QGraphicsScene /does/ receive the Gesture in Qt::GestureStarted state, but no Qt::GestureUpdated anymore. But only in case of Pan Gestures: In case of Pinch Gestures it works, regardless of where the mouse cursor is located in the scene (at the time when the Gesture is started). 

Pan Gesture also works as expected when the mouse cursor is /not/ located over any item. The items themselves are stock QGraphicsPixmapItems, and I explicitly do not accept touch events for them (but it does not seem to matter, I tried also accepting touch events for the items).

Maybe if you could download and compile (qmake; make) that example (http://bugreports.qt.nokia.com/secure/attachment/19372/GraphicsViewGesture.zip) and tell me about the outcome on your platform (with Qt 4.7.1 if possible - but would also be interesting to test with Qt 4.6.x). Note that the Gestures do nothing more than create qDebug output on the console, and in case of Pan the cursor is changed. But in my case the cursor keeps its "Pan" cross arrow, because no "end" Gesture state is received either. 

If you have some spare 5 minutes time, that is ;)

Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22




More information about the Qt-interest-old mailing list