summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qevent.cpp13
-rw-r--r--src/gui/kernel/qevent.h2
-rw-r--r--src/gui/kernel/qgesture.cpp65
-rw-r--r--src/gui/kernel/qgesture.h9
-rw-r--r--src/gui/kernel/qwidget.cpp8
5 files changed, 48 insertions, 49 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 3ce2517..dbfe528 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3540,13 +3540,6 @@ QGestureEvent::QGestureEvent(const QList<QGesture*> &gestures,
m_gestures.insert(r->gestureType(), QSharedPointer<QGesture>(r));
}
-QGestureEvent::QGestureEvent(const QGestureEvent &event, const QPoint &offset)
- : QEvent(QEvent::Gesture), m_gestures(event.m_gestures),
- m_cancelledGestures(event.m_cancelledGestures)
-{
- //### use offset!
-}
-
/*!
Destroys the QGestureEvent object.
*/
@@ -3555,7 +3548,8 @@ QGestureEvent::~QGestureEvent()
}
/*!
- Checks if the gesture event contains gesture of specific \a type.
+ Returns true if the gesture event contains gesture of specific \a
+ type; returns false otherwise.
*/
bool QGestureEvent::contains(Qt::GestureType type) const
{
@@ -3563,7 +3557,8 @@ bool QGestureEvent::contains(Qt::GestureType type) const
}
/*!
- Checks if the gesture event contains gesture of specific \a type.
+ Returns true if the gesture event contains gesture of specific \a
+ type; returns false otherwise.
*/
bool QGestureEvent::contains(const QString &type) const
{
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 48e420a..41005d8 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -719,8 +719,6 @@ class Q_GUI_EXPORT QGestureEvent : public QEvent
public:
QGestureEvent(const QList<QGesture*> &gestures,
const QSet<QString> &cancelledGestures = QSet<QString>());
- // internal ctor
- QGestureEvent(const QGestureEvent &gestures, const QPoint &offset);
~QGestureEvent();
bool contains(Qt::GestureType type) const;
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index b2bb859..35a3e2a 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -64,13 +64,23 @@ QString qt_getStandardGestureTypeName(Qt::GestureType type);
information. However, if the gesture developer wants to add a new
property to the gesture object that describe coordinate (like a
QPoint or QRect), it is required to subclass the QGesture and
- re-implement the \l{QGesture::}{translate} function to make sure
+ re-implement the \l{QGesture::}{translate()} function to make sure
the coordinates are translated properly when the gesture event is
propagated to parent widgets.
\sa QGestureEvent, QGestureRecognizer
*/
+/*! \fn QString QGesture::gestureType() const
+
+ Returns the type of the gesture.
+*/
+
+/*! \fn Qt::GestureState QGesture::state() const
+
+ Returns the current state of the gesture.
+*/
+
/*!
Creates a new gesture object of type \a type in a \a state and
marks it as a child of \a parent.
@@ -141,7 +151,9 @@ void QGesture::translate(const QPoint &offset)
}
/*!
- Returns a bounding rect of a gesture.
+ \property QGesture::rect
+
+ \brief The bounding rect of a gesture.
*/
QRect QGesture::rect() const
{
@@ -149,7 +161,9 @@ QRect QGesture::rect() const
}
/*!
- Returns a center point of a gesture.
+ \property QGesture::hotSpot
+
+ \brief The center point of a gesture.
*/
QPoint QGesture::hotSpot() const
{
@@ -157,7 +171,9 @@ QPoint QGesture::hotSpot() const
}
/*!
- Returns a time when the gesture has started.
+ \property QGesture::startTime
+
+ \brief The time when the gesture has started.
*/
QDateTime QGesture::startTime() const
{
@@ -165,7 +181,9 @@ QDateTime QGesture::startTime() const
}
/*!
- Returns a duration time of a gesture.
+ \property QGesture::duration
+
+ \brief The duration time of a gesture.
*/
uint QGesture::duration() const
{
@@ -173,7 +191,9 @@ uint QGesture::duration() const
}
/*!
- Returns the start position of the pointer.
+ \property QGesture::startPos
+
+ \brief The start position of the pointer.
*/
QPoint QGesture::startPos() const
{
@@ -181,7 +201,9 @@ QPoint QGesture::startPos() const
}
/*!
- Returns the last recorded position of the pointer.
+ \property QGesture::lastPos
+
+ \brief The last recorded position of the pointer.
*/
QPoint QGesture::lastPos() const
{
@@ -189,7 +211,9 @@ QPoint QGesture::lastPos() const
}
/*!
- Returns the position of the pointer.
+ \property QGesture::pos
+
+ \brief The current position of the pointer.
*/
QPoint QGesture::pos() const
{
@@ -206,28 +230,11 @@ QPoint QGesture::pos() const
information is also contained in the QGesture object in it's
properties.
*/
-QPannableGesture::QPannableGesture(QObject *parent, const QPoint &startPos,
- const QPoint &lastPos, const QPoint &pos, const QRect &rect,
- const QPoint &hotSpot, const QDateTime &startTime,
- uint duration, Qt::GestureState state)
- : QGesture(*new QPannableGesturePrivate, parent,
- qt_getStandardGestureTypeName(Qt::PanGesture), state)
-{
- Q_D(QPannableGesture);
- d->init(startPos, lastPos, pos, rect, hotSpot, startTime, duration);
- setProperty("lastDirection", QVariant::fromValue(Qt::NoDirection));
- setProperty("direction", QVariant::fromValue(Qt::NoDirection));
-}
/*!
- Destroys the QPannableGesture object.
-*/
-QPannableGesture::~QPannableGesture()
-{
-}
+ \property QPannableGesture::lastDirection
-/*!
- Returns the last recorded direction of panning.
+ \brief The last recorded direction of panning.
*/
Qt::DirectionType QPannableGesture::lastDirection() const
{
@@ -235,7 +242,9 @@ Qt::DirectionType QPannableGesture::lastDirection() const
}
/*!
- Returns the current direction of panning.
+ \property QPannableGesture::direction
+
+ \brief The current direction of panning.
*/
Qt::DirectionType QPannableGesture::direction() const
{
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index b2999d7..4e692be 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -107,13 +107,10 @@ class Q_GUI_EXPORT QPannableGesture : public QGesture
Q_OBJECT
Q_DECLARE_PRIVATE(QPannableGesture)
-public:
- QPannableGesture(QObject *parent, const QPoint &startPos,
- const QPoint &lastPos, const QPoint &pos, const QRect &rect,
- const QPoint &hotSpot, const QDateTime &startTime,
- uint duration, Qt::GestureState state);
- ~QPannableGesture();
+ Q_PROPERTY(Qt::DirectionType lastDirection READ lastDirection)
+ Q_PROPERTY(Qt::DirectionType direction READ direction)
+public:
Qt::DirectionType lastDirection() const;
Qt::DirectionType direction() const;
};
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index d37f360..9c0c404 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -11032,7 +11032,7 @@ QWindowSurface *QWidget::windowSurface() const
Returns the id of the gesture.
- \sa grabGesture(), releaseGesture(), setGestureEnabled()
+ \sa releaseGesture(), setGestureEnabled()
*/
int QWidget::grabGesture(const QString &gesture)
{
@@ -11055,7 +11055,7 @@ int QWidgetPrivate::grabGesture(int id)
Returns the id of the gesture.
- \sa grabGesture(), releaseGesture(), setGestureEnabled()
+ \sa releaseGesture(), setGestureEnabled()
*/
int QWidget::grabGesture(Qt::GestureType gesture)
{
@@ -11066,7 +11066,7 @@ int QWidget::grabGesture(Qt::GestureType gesture)
Unsubscribes the widget from a gesture, which is specified by the
\a gestureId.
- \sa grabGesture(),setGestureEnabled()
+ \sa grabGesture(), setGestureEnabled()
*/
void QWidget::releaseGesture(int gestureId)
{
@@ -11087,7 +11087,7 @@ void QWidget::releaseGesture(int gestureId)
\sa grabGesture(), releaseGesture()
*/
-void setGestureEnabled(int gestureId, bool enable)
+void QWidget::setGestureEnabled(int gestureId, bool enable)
{
//###
}