Hi,

I would guess that it first has to go through
QGraphicsView::viewportEvent(pEvent); ( because it redirects the event to
the correct GraphicsObject ). I'd guess that
QGraphicsView::viewportEvent(pEvent); will return whether the event was
consumed or not.

Cheers,
Marcus


On [DATE], "Sean Hayes" <[ADDRESS]> wrote:

> I am using Qt 4.6.3 with Windows 7 with Multi-Touch hardware. I am
> creating a QGraphicsObject that receives QGestureEvents using the
> following function:
> 
> bool MyGraphicsObject::sceneEvent(QEvent* pEvent) {
> switch (pEvent->type()) {
> case QEvent::TouchBegin: // Needed to get around potential Qt bug
> pEvent->accept();
> return true;
> case QEvent::Gesture:
> std::cout << "Gesture Event Received from sceneEvent()" << std::endl;
> pGestureEvent->accept();
> return true;
> }
> 
> return QMapItem::sceneEvent(pEvent);
> }
> 
> However, those events are still getting passed to viewport because my
> QGraphicsView is receiving them as well via:
> 
> bool MyGraphicsView::viewportEvent(QEvent *pEvent) {
> if(pEvent->type() == QEvent::Gesture) {
>                 std::cout << "Gesture Event Received from
> viewportEvent()" << std::endl;
> pEvent->accept();
> return true;
> }
> 
> return QGraphicsView::viewportEvent(pEvent);
> }
> 
> It seems to me that if the QGraphicsItem receives a gesture, the
> gesture should not be passed to the viewpoint unless the QGraphicsItem
> passes the event to its super class. Is that correct? Is there a way
> for me to make this happen?
> 
> Thank you for your help.
> _______________________________________________
> Qt4-preview-feedback mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Marcus Tillmanns
Manager Software Engineering | P&S Creative Enthusiasts

Avid
Birkenstrasse 15
28195 Bremen
Germany
[email protected]

t +49 421 4337599 

We're Avid.  Learn more at www.avid.com

Avid Development GmbH; Paul-Heyse-Str. 29, D-80336 München
Amtsgericht München HRB 155339, USt. ID. Nr. DE 814232828
Geschäftsführer: Paige Parisi, Jochen Pielage, Kenneth A. Sexton


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

Reply via email to