Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QEventTransition Class

The QEventTransition class provides a QObject-specific transition for Qt events. More...

 #include <QEventTransition>

Inherits: QAbstractTransition.

Inherited by: QKeyEventTransition and QMouseEventTransition.

This class was introduced in Qt 4.6.

Properties

  • 1 property inherited from QObject

Public Functions

QAbstractTransition(QState * sourceState = 0)
QEventTransition(QState * sourceState = 0)
QEventTransition(QObject * object, QEvent::Type type, QState * sourceState = 0)
virtual ~QAbstractTransition()
~QEventTransition()
void addAnimation(QAbstractAnimation * animation)
QList<QAbstractAnimation *> animations() const
QObject * eventSource() const
QEvent::Type eventType() const
QStateMachine * machine() const
void removeAnimation(QAbstractAnimation * animation)
void setEventSource(QObject * object)
void setEventType(QEvent::Type type)
void setTargetState(QAbstractState * target)
void setTargetStates(const QList<QAbstractState *> & targets)
QState * sourceState() const
QAbstractState * targetState() const
QList<QAbstractState *> targetStates() const
  • 31 public functions inherited from QObject

Signals

void triggered()

Protected Functions

virtual bool event(QEvent * e)
virtual bool eventTest(QEvent * event) = 0
virtual void onTransition(QEvent * event) = 0

Reimplemented Protected Functions

virtual bool event(QEvent * e)
virtual bool eventTest(QEvent * event)
virtual void onTransition(QEvent * event)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject

Detailed Description

The QEventTransition class provides a QObject-specific transition for Qt events.

A QEventTransition object binds an event to a particular QObject. QEventTransition is part of The State Machine Framework.

Example:

 QPushButton *button = ...;
 QState *s1 = ...;
 QState *s2 = ...;
 // If in s1 and the button receives an Enter event, transition to s2
 QEventTransition *enterTransition = new QEventTransition(button, QEvent::Enter);
 enterTransition->setTargetState(s2);
 s1->addTransition(enterTransition);
 // If in s2 and the button receives an Exit event, transition back to s1
 QEventTransition *leaveTransition = new QEventTransition(button, QEvent::Leave);
 leaveTransition->setTargetState(s1);
 s2->addTransition(leaveTransition);

Subclassing

When reimplementing the eventTest() function, you should first call the base implementation to verify that the event is a QStateMachine::WrappedEvent for the proper object and event type. You may then cast the event to a QStateMachine::WrappedEvent and get the original event by calling QStateMachine::WrappedEvent::event(), and perform additional checks on that object.

See also QState::addTransition().

Property Documentation

eventSource : QObject *

This property holds the event source that this event transition is associated with.

Access functions:

QObject * eventSource() const
void setEventSource(QObject * object)

eventType : QEvent::Type

This property holds the type of event that this event transition is associated with.

Access functions:

QEvent::Type eventType() const
void setEventType(QEvent::Type type)

Member Function Documentation

QEventTransition::QEventTransition(QState * sourceState = 0)

Constructs a new QEventTransition object with the given sourceState.

QEventTransition::QEventTransition(QObject * object, QEvent::Type type, QState * sourceState = 0)

Constructs a new QEventTransition object associated with events of the given type for the given object, and with the given sourceState.

QEventTransition::~QEventTransition()

Destroys this QObject event transition.

bool QEventTransition::event(QEvent * e) [virtual protected]

Reimplemented from QObject::event().

bool QEventTransition::eventTest(QEvent * event) [virtual protected]

Reimplemented from QAbstractTransition::eventTest().

void QEventTransition::onTransition(QEvent * event) [virtual protected]

Reimplemented from QAbstractTransition::onTransition().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web