Hi Sean,

On 18 June 2010 05:19, Sean Hayes <[email protected]> wrote:
> I am having problems getting any QGestureEvents on a QGraphicsObjects.
> I think these events are not getting propagated properly. Here is an
> example/test of an object that does not receive any QGestureEvents
> that it grabs. Is this a Qt bug? I am using Qt 4.6.3 on Windows 7
> (also tried Qt 4.7.0 beta 1).

indeed that looks like a bug (or misfeature).

> class TouchObject : public QGraphicsObject {
>       Q_OBJECT
> public:
>       bool sceneEvent(QEvent* pEvent) {
>               switch (pEvent->type()) {

adding the following here seems to fix the issue.

case  QEvent::TouchBegin:
    pEvent->accept();
    return true;

>                       case QEvent::Gesture:
>                               std::cout << "Gesture Event Received
> from sceneEvent()" << std::endl;
>               }
>
>               return QGraphicsObject::sceneEvent(pEvent);
>       }

-- 
Best regards,
Denis.

_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to