[Qt-interest] Thoughts about QGestures

Guido Seifert Wargand at gmx.de
Wed May 19 19:13:10 CEST 2010


Hi.
You told me how to create my own gesture recognizer. Yes, I can do that.
But this is far from an equivalent to a QPanGesture. You left out the
interesting part. The pattern recognition in the list of points you 
can get from the mouse movement between the mouse press and mouse release. ;-)

Guido



> You can do something like this:
> 
> class MyPanRecognizer : public QGestureRecognizer
> {
> public:
>    QGesture* create(QObject* ) { return new QPanGesture; }
>    QGestureRecognizer::Result recognizer(QGesture *g, QObject *, QEvent
> *e)
>    {
>        if (e->type() == QEvent::MouseMove) return
> QGestureRecognizer::TriggerGesture;
>        if (e->type() == QEvent::MouseButtonRelease) return
> QGestureRecognizer::FinishGesture;
>        return QGestureRecognizer::Ignore;
>    }
> };
> 

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Qt-interest-old mailing list