[Qt-interest] cannot grab gesture with qgraphicsobject

Till Oliver Knoll till.oliver.knoll at gmail.com
Mon Mar 7 23:02:08 CET 2011


Am 07.03.11 19:31, schrieb Wathek LOUED:
 > Hi,
 >
 > I got a problem with QGraphicsObject, I cannot grab gesture and I'm
 > getting this message : QGestureManager::deliverEvent: could not find the
 > target for gesture.

My experience up to Qt 4.7.1 is that QGestures are not as "mature" as 
one would wish, especially on Mac.

I had a somewhat similar issue that Pan gesture would not get through to 
QGraphicsObjects in a QGraphicsScene. It turned out that this is a 
"design issue" (how Gestures are implemented respective how items in a 
scene deal with events) and won't be fixed:

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

There is an example attached which shows how gestures SHOULD work with 
QGraphicsObjects. Note that up to Qt 4.6.x also the QGraphicsView (the 
view widget thereof!) had to grab the same gestures as the item itself. 
This should not be necessary anymore with Qt 4.7.x.

So in my case the QGraphicsObject did not receive Pan gesture events 
(only the "start" event, but never the "update" or "end" events). Never 
tried "Tab" events, but I got "pinch" (zoom/rotate) to work.

But just now I am investigating another issue: it seems that the value of

  http://doc.trolltech.com/4.7/qpinchgesture.html#scaleFactor-prop

returns different signed values on Mac and Windows 7. I developped my 
app on Mac and implemented my "zoom" in such a way that when moving the 
fingers apart the object would get bigger.

A quick test on some netbook and laptop running Windows 7 revealed that 
the "zoom" would work the other way (the object was scaled down instead 
of scaled up). So I assume it is the sign which is different on Mac and 
Windows 7 (= bug). But again, I did not have the opportunity yet to 
reproduce this behaviour with debugging possibilities.


Hope that gives you some pointers,
   Oliver



More information about the Qt-interest-old mailing list