Qt 4.8
|
The QGestureEvent class provides the description of triggered gestures. More...
#include <qevent.h>
Public Functions | |
void | accept (QGesture *) |
Sets the accept flag of the given gesture object, the equivalent of calling setAccepted(gesture, true). More... | |
void | accept (Qt::GestureType) |
Sets the accept flag of the given gestureType, the equivalent of calling setAccepted(gestureType, true). More... | |
QList< QGesture * > | activeGestures () const |
Returns a list of active (not canceled) gestures. More... | |
QList< QGesture * > | canceledGestures () const |
Returns a list of canceled gestures. More... | |
QGesture * | gesture (Qt::GestureType type) const |
Returns a gesture object by type. More... | |
QList< QGesture * > | gestures () const |
Returns all gestures that are delivered in the event. More... | |
void | ignore (QGesture *) |
Clears the accept flag parameter of the given gesture object, the equivalent of calling setAccepted(gesture, false). More... | |
void | ignore (Qt::GestureType) |
Clears the accept flag parameter of the given gestureType, the equivalent of calling setAccepted(gesture, false). More... | |
bool | isAccepted (QGesture *) const |
Returns true if the gesture is accepted; otherwise returns false. More... | |
bool | isAccepted (Qt::GestureType) const |
Returns true if the gesture of type gestureType is accepted; otherwise returns false. More... | |
QPointF | mapToGraphicsScene (const QPointF &gesturePoint) const |
Returns the scene-local coordinates if the gesturePoint is inside a graphics view. More... | |
QGestureEvent (const QList< QGesture *> &gestures) | |
Creates new QGestureEvent containing a list of gestures. More... | |
void | setAccepted (QGesture *, bool) |
Sets the accept flag of the given gesture object to the specified value. More... | |
void | setAccepted (Qt::GestureType, bool) |
Sets the accept flag of the given gestureType object to the specified value. More... | |
void | setWidget (QWidget *widget) |
Sets the widget for this event to the widget specified. More... | |
QWidget * | widget () const |
Returns the widget on which the event occurred. More... | |
~QGestureEvent () | |
Destroys QGestureEvent. More... | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
Private Functions | |
QGestureEventPrivate * | d_func () |
const QGestureEventPrivate * | d_func () const |
Friends | |
class | QApplication |
class | QGestureManager |
The QGestureEvent class provides the description of triggered gestures.
The QGestureEvent class contains a list of gestures, which can be obtained using the gestures() function.
The gestures are either active or canceled. A list of those that are currently being executed can be obtained using the activeGestures() function. A list of those which were previously active and have been canceled can be accessed using the canceledGestures() function. A gesture might be canceled if the current window loses focus, for example, or because of a timeout, or for other reasons.
If the event handler does not accept the event by calling the generic QEvent::accept() function, all individual QGesture object that were not accepted and in the Qt::GestureStarted state will be propagated up the parent widget chain until a widget accepts them individually, by calling QGestureEvent::accept() for each of them, or an event filter consumes the event.
For an overview of gesture handling in Qt and information on using gestures in your applications, see the Gestures Programming document.
Creates new QGestureEvent containing a list of gestures.
Definition at line 4856 of file qevent.cpp.
QGestureEvent::~QGestureEvent | ( | ) |
void QGestureEvent::accept | ( | QGesture * | gesture | ) |
Sets the accept flag of the given gesture object, the equivalent of calling setAccepted(gesture, true).
Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.
Definition at line 4944 of file qevent.cpp.
void QGestureEvent::accept | ( | Qt::GestureType | gestureType | ) |
Sets the accept flag of the given gestureType, the equivalent of calling setAccepted(gestureType, true).
Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.
Definition at line 5003 of file qevent.cpp.
Returns a list of active (not canceled) gestures.
Definition at line 4893 of file qevent.cpp.
Returns a list of canceled gestures.
Definition at line 4906 of file qevent.cpp.
|
private |
Definition at line 5079 of file qevent.cpp.
Referenced by activeGestures(), canceledGestures(), gesture(), gestures(), isAccepted(), QApplication::notify(), setAccepted(), setWidget(), and widget().
|
private |
Definition at line 5087 of file qevent.cpp.
QGesture * QGestureEvent::gesture | ( | Qt::GestureType | type | ) | const |
Returns a gesture object by type.
Definition at line 4881 of file qevent.cpp.
Referenced by activeGestures(), canceledGestures(), QAbstractScrollArea::event(), QPlainTextEdit::event(), and QDeclarativeGestureAreaPrivate::gestureEvent().
Returns all gestures that are delivered in the event.
Definition at line 4873 of file qevent.cpp.
Referenced by activeGestures(), canceledGestures(), QGestureManager::deliverEvents(), and QApplication::notify().
void QGestureEvent::ignore | ( | QGesture * | gesture | ) |
Clears the accept flag parameter of the given gesture object, the equivalent of calling setAccepted(gesture, false).
Clearing the accept flag indicates that the event receiver does not want the gesture. Unwanted gestures may be propagated to the parent widget.
Definition at line 4959 of file qevent.cpp.
void QGestureEvent::ignore | ( | Qt::GestureType | gestureType | ) |
Clears the accept flag parameter of the given gestureType, the equivalent of calling setAccepted(gesture, false).
Clearing the accept flag indicates that the event receiver does not want the gesture. Unwanted gestures may be propgated to the parent widget.
Definition at line 5017 of file qevent.cpp.
bool QGestureEvent::isAccepted | ( | QGesture * | gesture | ) | const |
Returns true if the gesture is accepted; otherwise returns false.
Definition at line 4968 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::cancelGesturesForChildren(), QGestureManager::deliverEvents(), and QApplication::notify().
bool QGestureEvent::isAccepted | ( | Qt::GestureType | gestureType | ) | const |
Returns true if the gesture of type gestureType is accepted; otherwise returns false.
Definition at line 5026 of file qevent.cpp.
Returns the scene-local coordinates if the gesturePoint is inside a graphics view.
This functional might be useful when the gesture event is delivered to a QGraphicsObject to translate a point in screen coordinates to scene-local coordinates.
Definition at line 5063 of file qevent.cpp.
void QGestureEvent::setAccepted | ( | QGesture * | gesture, |
bool | value | ||
) |
Sets the accept flag of the given gesture object to the specified value.
Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.
By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored.
For convenience, the accept flag can also be set with accept(gesture), and cleared with ignore(gesture).
Definition at line 4929 of file qevent.cpp.
Referenced by accept(), ignore(), QApplication::notify(), and setAccepted().
void QGestureEvent::setAccepted | ( | Qt::GestureType | gestureType, |
bool | value | ||
) |
Sets the accept flag of the given gestureType object to the specified value.
Setting the accept flag indicates that the event receiver wants to receive gestures of the specified type, gestureType. Unwanted gestures may be propagated to the parent widget.
By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored.
For convenience, the accept flag can also be set with accept(gestureType), and cleared with ignore(gestureType).
Definition at line 4988 of file qevent.cpp.
void QGestureEvent::setWidget | ( | QWidget * | widget | ) |
Sets the widget for this event to the widget specified.
Definition at line 5039 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::gestureEventHandler().
QWidget * QGestureEvent::widget | ( | ) | const |
Returns the widget on which the event occurred.
Definition at line 5047 of file qevent.cpp.
Referenced by QGraphicsScenePrivate::gestureEventHandler(), mapToGraphicsScene(), and setWidget().
|
friend |
|
friend |