Hi Josh, I think most widgets are expecting Press, Release, DoubleClick, Release sequences.
In my own code, I've had to set a flag on the double-click, then action it on the following release. This was where the double-click was to open another dialog. Without this, the release would trigger a click in the new form, which the client did not want to occur. Maybe QInputMethod might be more appropriate in your case? Hope that helps. Tony > Sent: Friday, 22 February 2013 4:36 PM > > Hello all, > > I'm trying to write a global proceedure to convert all QTapAndHoldGesture > events to mouse double click events. I thought this should be trivial, but it's > really stumping me. > > I setup an event filter globally for my QApplication and grab the gesture as > follow: > app.installEventFilter(&myobj); > mainWin->grabGesture(Qt::TapAndHoldGesture); > > And then I have an event filter as follows: > > bool myObject::eventFilter(QObject *obj, QEvent *e) > { > if(e->type() == QEvent::Gesture) > { > QGestureEvent *event = static_cast<QGestureEvent*>(e); > if(QGesture *gest = event->gesture(Qt::TapAndHoldGesture)) > { > QTapAndHoldGesture *tah = static_cast<QTapAndHoldGesture *>(gest); > QMouseEvent dblClk(QEvent::MouseButtonDblClick, tah- > >position().toPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); > QApplication::sendEvent(obj, &dblClk); > return true; > } > } > } > > I receive the gesture events fine, but for some reason when none of my > widgets receive the double click events. I've tried lots of different > options for instantiating my QMouseEvent. I've tried calling grabMouse on > the widget before sending the event, but still nothing receives double > click events. Does anyone have an idea of why none of my widgets receive > the double click events? > > Thanks! > > Josh _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest