summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-15 14:00:46 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-02 15:16:07 (GMT)
commit60e965fd35037f4a27816d2aeccafdff0d6ae9d6 (patch)
tree8a968022a03057cc29aa3f7cc246ee708d869b8a /src/gui/kernel/qevent.cpp
parent099a32d121cbc80a1a234c3146f4be9b5237e7e8 (diff)
downloadQt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.zip
Qt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.tar.gz
Qt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.tar.bz2
Refactored gesture api
Rewritten the api almost from scratch, making it simplier and more flexible at the same time. The current implementation will not have complex gseturemanager class inside Qt, but the QGesture base class, which represents both a gesture recognizer and a gesture itself with a set of properties. A set of common gestures that can use used in third-party applications (and in Qt itself internally) is supposed to be found in qstandardgestures.h, and a base class for user-defined gestures is in qgesture.h Gesture implementation for Pan on Windows7 has also been added as a reference implementation for platform gestures.
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r--src/gui/kernel/qevent.cpp156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index a7a7f2d..bef7ee1 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -53,8 +53,6 @@
QT_BEGIN_NAMESPACE
-QString qt_getStandardGestureTypeName(Qt::GestureType type);
-
/*!
\class QInputEvent
\ingroup events
@@ -3332,9 +3330,6 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
case QEvent::ChildRemoved: n = n ? n : "ChildRemoved";
dbg.nospace() << "QChildEvent(" << n << ", " << (static_cast<const QChildEvent*>(e))->child();
return dbg.space();
- case QEvent::Gesture:
- n = "Gesture";
- break;
default:
dbg.nospace() << "QEvent(" << (const void *)e << ", type = " << e->type() << ')';
return dbg.space();
@@ -3531,157 +3526,6 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
#endif
-/*!
- \class QGestureEvent
- \since 4.6
- \ingroup events
-
- \brief The QGestureEvent class provides the parameters used for
- gesture recognition.
-
- The QGestureEvent class contains a list of gestures that are being
- executed right now (\l{QGestureEvent::}{gestureTypes()}) and a
- list of gestures that are cancelled (the gesture might be
- cancelled because the window lost focus, or because of timeout,
- etc).
-
- \sa QGesture
-*/
-
-/*!
- Creates new QGestureEvent containing a list of \a gestures that
- are being executed and a list of gesture that were cancelled (\a
- cancelledGestures).
-*/
-QGestureEvent::QGestureEvent(const QSet<QGesture*> &gestures,
- const QSet<QString> &cancelledGestures)
- : QEvent(QEvent::Gesture), m_cancelledGestures(cancelledGestures)
-{
- setAccepted(false);
- foreach(QGesture *r, gestures)
- m_gestures.insert(r->type(), r);
-}
-
-/*!
- Destroys the QGestureEvent object.
-*/
-QGestureEvent::~QGestureEvent()
-{
-}
-
-/*!
- Returns true if the gesture event contains gesture of specific \a
- type; returns false otherwise.
-*/
-bool QGestureEvent::contains(Qt::GestureType type) const
-{
- return contains(qt_getStandardGestureTypeName(type));
-}
-
-/*!
- Returns true if the gesture event contains gesture of specific \a
- type; returns false otherwise.
-*/
-bool QGestureEvent::contains(const QString &type) const
-{
- return gesture(type) != 0;
-}
-
-/*!
- Returns a list of gesture names that this event contains.
-*/
-QList<QString> QGestureEvent::gestureTypes() const
-{
- return m_gestures.keys();
-}
-
-/*!
- Returns extended information about a gesture of specific \a type.
-*/
-const QGesture* QGestureEvent::gesture(Qt::GestureType type) const
-{
- return gesture(qt_getStandardGestureTypeName(type));
-}
-
-/*!
- Returns extended information about a gesture of specific \a type.
-*/
-const QGesture* QGestureEvent::gesture(const QString &type) const
-{
- return m_gestures.value(type, 0);
-}
-
-/*!
- Returns extended information about all gestures in the event.
-*/
-QList<QGesture*> QGestureEvent::gestures() const
-{
- return m_gestures.values();
-}
-
-/*!
- Returns a set of gesture names that used to be executed, but were
- cancelled (i.e. they were not finished properly).
-*/
-QSet<QString> QGestureEvent::cancelledGestures() const
-{
- return m_cancelledGestures;
-}
-
-/*! \fn void QGestureEvent::accept()
- Calls QEvent::accept().
-*/
-
-/*!
- Sets the accept flag of the all gestures inside the event object,
- the equivalent of calling \l{QEvent::accept()}{accept()} or
- \l{QEvent::setAccepted()}{setAccepted(true)}.
-
- Setting the accept parameter indicates that the event receiver
- wants the gesture. Unwanted gestures might be propagated to the parent
- widget.
-*/
-void QGestureEvent::acceptAll()
-{
- QHash<QString, QGesture*>::iterator it = m_gestures.begin(),
- e = m_gestures.end();
- for(; it != e; ++it)
- it.value()->accept();
- setAccepted(true);
-}
-
-/*!
- Sets the accept flag of the gesture specified by \a type.
- This is equivalent to calling
- \l{QGestureEvent::gesture()}{gesture(type)}->
- \l{QGesture::accept()}{accept()}
-
- Setting the accept flag indicates that the event receiver wants
- the gesture. Unwanted gestures might be propagated to the parent
- widget.
-*/
-void QGestureEvent::accept(Qt::GestureType type)
-{
- if (QGesture *g = m_gestures.value(qt_getStandardGestureTypeName(type), 0))
- g->accept();
-}
-
-/*!
- Sets the accept flag of the gesture specified by \a type.
- This is equivalent to calling
- \l{QGestureEvent::gesture()}{gesture(type)}->
- \l{QGesture::accept()}{accept()}
-
- Setting the accept flag indicates that the event receiver wants
- the gesture. Unwanted gestures might be propagated to the parent
- widget.
-*/
-void QGestureEvent::accept(const QString &type)
-{
- if (QGesture *g = m_gestures.value(type, 0))
- g->accept();
-}
-
/*! \class QTouchEvent
\brief The QTouchEvent class contains parameters that describe a touch event
.