[Qt-interest] cannot grab gesture with qgraphicsobject

Till Oliver Knoll till.oliver.knoll at gmail.com
Wed Mar 16 08:20:23 CET 2011



Am 15.03.2011 um 10:44 schrieb Wathek LOUED <wathek at gmail.com>:

> 
> However I'm thinking of a solution to make this working.

To make this working in your particular application? Or are you saying you are working on some Qt gestures related patch? :)


> Maybe I can use QGraphicsScene::itemAt function so that if a Gesture has been recognized and there's an item at that position QGraphicsScene will create either a signal or an event and send it to the item.

That might work in the case where the QGraphicsView/Scene itself would actually receive the gesture events, and even then would you currently run into problems with e.g. Pan gestures on Mac, as soon as you have any QGraphicsItem under the mouse: the gesture "starts" (event), but all successive Update and Finish events are "swallowed", so your scene won't get them. And according to Nokia this is "Out of scope", because of how event handling and propagation in QGraphicsScene is currently implemented that would require major redesign work.

And as I wrote earlier my (test) application does not receive /any/ gesture events on Windows 7 (Starter Edition on some Samsung Netbook), even though gestures are enabled in the trackpad settings and the trackpad seems to at least recognise pinch zoom and rotate gestures, recogniseable by the changing mouse pointer.

To my surprise not even the Qt "imagegesture" example seemed to work at all on said Netbook, which might indicate that this might not be a good reference platform to test. However I observed the same behaviour on some "big scale" Dell laptop with Windows 7 Professional (or "Enterprise" or whatever): my actual app only received "CTRL + mouse wheel" events, but no rotate gesture events.

(Unfortunatelly I don't have access anymore to that Dell laptop and could not try the Qt example.)

Again, I am only dealing with gesture events on a QGraphicsScene level, since I quickly gave up handling them on a "per item basis" after noticing that on Mac QGraphicsObjects don't receive any gesture events at all (bug reported and mentioned in my previous  post as well).

I am sure there must be some Windows 7 platform/hardware combination where gestures work. Would be interesting to know if there are other people where the Qt example "imagegesture" does not work on Windows 7.

By the way, I am using Qt 4.7.2 MinGW binary distribution. Is it possible that this flavour does not support gestures at all (again due to some "patented" MS header files or so which makes it impossible to use it from MinGW, as (was?) the case with DirectX headers IIRC)?

Cheers,
  Oliver



More information about the Qt-interest-old mailing list