diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-04-21 09:32:10 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-04-21 09:32:10 (GMT) |
commit | 74773151efa5cd71b39350911525402bed5d2f87 (patch) | |
tree | 4ccf96dfec7a66e3b677b18d0a7dda7deb71f505 /src/corelib/statemachine | |
parent | 6e0926ff0c9044ed4e09630887c14657adf34a85 (diff) | |
download | Qt-74773151efa5cd71b39350911525402bed5d2f87.zip Qt-74773151efa5cd71b39350911525402bed5d2f87.tar.gz Qt-74773151efa5cd71b39350911525402bed5d2f87.tar.bz2 |
rename QTransition -> QActionTransition
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r-- | src/corelib/statemachine/qabstracttransition.cpp | 3 | ||||
-rw-r--r-- | src/corelib/statemachine/qactiontransition.cpp (renamed from src/corelib/statemachine/qtransition.cpp) | 66 | ||||
-rw-r--r-- | src/corelib/statemachine/qactiontransition.h (renamed from src/corelib/statemachine/qtransition.h) | 22 | ||||
-rw-r--r-- | src/corelib/statemachine/qactiontransition_p.h (renamed from src/corelib/statemachine/qtransition_p.h) | 18 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.cpp | 14 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.h | 8 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition_p.h | 4 | ||||
-rw-r--r-- | src/corelib/statemachine/qsignaltransition.cpp | 8 | ||||
-rw-r--r-- | src/corelib/statemachine/qsignaltransition.h | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qsignaltransition_p.h | 4 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatefinishedtransition.cpp | 10 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatefinishedtransition.h | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/statemachine.pri | 6 |
13 files changed, 88 insertions, 87 deletions
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp index aff7475..dfce310 100644 --- a/src/corelib/statemachine/qabstracttransition.cpp +++ b/src/corelib/statemachine/qabstracttransition.cpp @@ -60,9 +60,6 @@ QT_BEGIN_NAMESPACE QStateMachine. QAbstractTransition is part of \l{The State Machine Framework}. - The QTransition class provides a default (action-based) implementation of - the QAbstractTransition interface. - The sourceState() function returns the source of the transition. The targetStates() function returns the targets of the transition. diff --git a/src/corelib/statemachine/qtransition.cpp b/src/corelib/statemachine/qactiontransition.cpp index ec9cc81..7c53e15 100644 --- a/src/corelib/statemachine/qtransition.cpp +++ b/src/corelib/statemachine/qactiontransition.cpp @@ -39,24 +39,24 @@ ** ****************************************************************************/ -#include "qtransition.h" -#include "qtransition_p.h" +#include "qactiontransition.h" +#include "qactiontransition_p.h" #include "qstateaction.h" #include "qstateaction_p.h" QT_BEGIN_NAMESPACE /*! - \class QTransition + \class QActionTransition - \brief The QTransition class provides an action-based transition. + \brief The QActionTransition class provides an action-based transition. \since 4.6 \ingroup statemachine - QTransition provides an action-based transition; you add actions with the - addAction() function. The transition executes the actions when the - transition is triggered. QTransition is part of \l{The State Machine + QActionTransition provides an action-based transition; you add actions with + the addAction() function. The transition executes the actions when the + transition is triggered. QActionTransition is part of \l{The State Machine Framework}. The invokeMethodOnTransition() function is used for defining method @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE QStateMachine machine; QState *s1 = new QState(); machine.addState(s1); - QTransition *t1 = new QTransition(); + QActionTransition *t1 = new QActionTransition(); QLabel label; t1->invokeMethodOnTransition(&label, "clear"); QState *s2 = new QState(); @@ -80,25 +80,25 @@ QT_BEGIN_NAMESPACE \sa QState::addTransition(), QStateAction */ -QTransitionPrivate::QTransitionPrivate() +QActionTransitionPrivate::QActionTransitionPrivate() { } -QTransitionPrivate::~QTransitionPrivate() +QActionTransitionPrivate::~QActionTransitionPrivate() { } -QTransitionPrivate *QTransitionPrivate::get(QTransition *q) +QActionTransitionPrivate *QActionTransitionPrivate::get(QActionTransition *q) { return q->d_func(); } -const QTransitionPrivate *QTransitionPrivate::get(const QTransition *q) +const QActionTransitionPrivate *QActionTransitionPrivate::get(const QActionTransition *q) { return q->d_func(); } -QList<QStateAction*> QTransitionPrivate::actions() const +QList<QStateAction*> QActionTransitionPrivate::actions() const { QList<QStateAction*> result; QList<QObject*>::const_iterator it; @@ -114,26 +114,26 @@ QList<QStateAction*> QTransitionPrivate::actions() const } /*! - Constructs a new QTransition object with the given \a sourceState. + Constructs a new QActionTransition object with the given \a sourceState. */ -QTransition::QTransition(QState *sourceState) - : QAbstractTransition(*new QTransitionPrivate, sourceState) +QActionTransition::QActionTransition(QState *sourceState) + : QAbstractTransition(*new QActionTransitionPrivate, sourceState) { } /*! - Constructs a new QTransition object with the given \a targets and \a + Constructs a new QActionTransition object with the given \a targets and \a sourceState. */ -QTransition::QTransition(const QList<QAbstractState*> &targets, QState *sourceState) - : QAbstractTransition(*new QTransitionPrivate, targets, sourceState) +QActionTransition::QActionTransition(const QList<QAbstractState*> &targets, QState *sourceState) + : QAbstractTransition(*new QActionTransitionPrivate, targets, sourceState) { } /*! \internal */ -QTransition::QTransition(QTransitionPrivate &dd, QState *parent) +QActionTransition::QActionTransition(QActionTransitionPrivate &dd, QState *parent) : QAbstractTransition(dd, parent) { } @@ -141,7 +141,7 @@ QTransition::QTransition(QTransitionPrivate &dd, QState *parent) /*! \internal */ -QTransition::QTransition(QTransitionPrivate &dd, const QList<QAbstractState*> &targets, QState *parent) +QActionTransition::QActionTransition(QActionTransitionPrivate &dd, const QList<QAbstractState*> &targets, QState *parent) : QAbstractTransition(dd, targets, parent) { } @@ -149,17 +149,17 @@ QTransition::QTransition(QTransitionPrivate &dd, const QList<QAbstractState*> &t /*! Destroys this transition. */ -QTransition::~QTransition() +QActionTransition::~QActionTransition() { } /*! - Instructs this QTransition to invoke the given \a method of the given \a + Instructs this QActionTransition to invoke the given \a method of the given \a object with the given \a arguments when the transition is taken. This function will create a QStateInvokeMethodAction object and add it to the actions of the transition. */ -void QTransition::invokeMethodOnTransition(QObject *object, const char *method, +void QActionTransition::invokeMethodOnTransition(QObject *object, const char *method, const QList<QVariant> &arguments) { addAction(new QStateInvokeMethodAction(object, method, arguments)); @@ -172,10 +172,10 @@ void QTransition::invokeMethodOnTransition(QObject *object, const char *method, \sa removeAction() */ -void QTransition::addAction(QStateAction *action) +void QActionTransition::addAction(QStateAction *action) { if (!action) { - qWarning("QTransition::addAction: cannot add null action"); + qWarning("QActionTransition::addAction: cannot add null action"); return; } action->setParent(this); @@ -187,10 +187,10 @@ void QTransition::addAction(QStateAction *action) \sa addAction() */ -void QTransition::removeAction(QStateAction *action) +void QActionTransition::removeAction(QStateAction *action) { if (!action) { - qWarning("QTransition::removeAction: cannot remove null action"); + qWarning("QActionTransition::removeAction: cannot remove null action"); return; } action->setParent(0); @@ -202,18 +202,18 @@ void QTransition::removeAction(QStateAction *action) \sa addAction() */ -QList<QStateAction*> QTransition::actions() const +QList<QStateAction*> QActionTransition::actions() const { - Q_D(const QTransition); + Q_D(const QActionTransition); return d->actions(); } /*! \reimp */ -void QTransition::onTransition() +void QActionTransition::onTransition() { - Q_D(QTransition); + Q_D(QActionTransition); QList<QStateAction*> actions = d->actions(); for (int i = 0; i < actions.size(); ++i) QStateActionPrivate::get(actions.at(i))->callExecute(); @@ -222,7 +222,7 @@ void QTransition::onTransition() /*! \reimp */ -bool QTransition::event(QEvent *e) +bool QActionTransition::event(QEvent *e) { return QAbstractTransition::event(e); } diff --git a/src/corelib/statemachine/qtransition.h b/src/corelib/statemachine/qactiontransition.h index 7eec136..1a779fa 100644 --- a/src/corelib/statemachine/qtransition.h +++ b/src/corelib/statemachine/qactiontransition.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QTRANSITION_H -#define QTRANSITION_H +#ifndef QACTIONTRANSITION_H +#define QACTIONTRANSITION_H #ifndef QT_STATEMACHINE_SOLUTION #include <QtCore/qabstracttransition.h> @@ -59,14 +59,14 @@ QT_MODULE(Core) class QStateAction; -class QTransitionPrivate; -class Q_CORE_EXPORT QTransition : public QAbstractTransition +class QActionTransitionPrivate; +class Q_CORE_EXPORT QActionTransition : public QAbstractTransition { Q_OBJECT public: - QTransition(QState *sourceState = 0); - QTransition(const QList<QAbstractState*> &targets, QState *sourceState = 0); - ~QTransition(); + QActionTransition(QState *sourceState = 0); + QActionTransition(const QList<QAbstractState*> &targets, QState *sourceState = 0); + ~QActionTransition(); void invokeMethodOnTransition(QObject *object, const char *method, const QList<QVariant> &args = QList<QVariant>()); @@ -81,12 +81,12 @@ protected: bool event(QEvent *e); protected: - QTransition(QTransitionPrivate &dd, QState *parent); - QTransition(QTransitionPrivate &dd, const QList<QAbstractState*> &targets, QState *parent); + QActionTransition(QActionTransitionPrivate &dd, QState *parent); + QActionTransition(QActionTransitionPrivate &dd, const QList<QAbstractState*> &targets, QState *parent); private: - Q_DISABLE_COPY(QTransition) - Q_DECLARE_PRIVATE(QTransition) + Q_DISABLE_COPY(QActionTransition) + Q_DECLARE_PRIVATE(QActionTransition) }; QT_END_NAMESPACE diff --git a/src/corelib/statemachine/qtransition_p.h b/src/corelib/statemachine/qactiontransition_p.h index d43a4d4..34f80d1 100644 --- a/src/corelib/statemachine/qtransition_p.h +++ b/src/corelib/statemachine/qactiontransition_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QTRANSITION_P_H -#define QTRANSITION_P_H +#ifndef QACTIONTRANSITION_P_H +#define QACTIONTRANSITION_P_H // // W A R N I N G @@ -61,16 +61,16 @@ QT_BEGIN_NAMESPACE class QStateAction; -class QTransition; -class Q_CORE_EXPORT QTransitionPrivate : public QAbstractTransitionPrivate +class QActionTransition; +class Q_CORE_EXPORT QActionTransitionPrivate : public QAbstractTransitionPrivate { - Q_DECLARE_PUBLIC(QTransition) + Q_DECLARE_PUBLIC(QActionTransition) public: - QTransitionPrivate(); - ~QTransitionPrivate(); + QActionTransitionPrivate(); + ~QActionTransitionPrivate(); - static QTransitionPrivate *get(QTransition *q); - static const QTransitionPrivate *get(const QTransition *q); + static QActionTransitionPrivate *get(QActionTransition *q); + static const QActionTransitionPrivate *get(const QActionTransition *q); QList<QStateAction*> actions() const; }; diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index 078253a..87ed77a 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -129,7 +129,7 @@ void QEventTransitionPrivate::invalidate() Constructs a new QEventTransition object with the given \a sourceState. */ QEventTransition::QEventTransition(QState *sourceState) - : QTransition(*new QEventTransitionPrivate, sourceState) + : QActionTransition(*new QEventTransitionPrivate, sourceState) { } @@ -139,7 +139,7 @@ QEventTransition::QEventTransition(QState *sourceState) */ QEventTransition::QEventTransition(QObject *object, QEvent::Type type, QState *sourceState) - : QTransition(*new QEventTransitionPrivate, sourceState) + : QActionTransition(*new QEventTransitionPrivate, sourceState) { Q_D(QEventTransition); d->registered = false; @@ -155,7 +155,7 @@ QEventTransition::QEventTransition(QObject *object, QEvent::Type type, QEventTransition::QEventTransition(QObject *object, QEvent::Type type, const QList<QAbstractState*> &targets, QState *sourceState) - : QTransition(*new QEventTransitionPrivate, targets, sourceState) + : QActionTransition(*new QEventTransitionPrivate, targets, sourceState) { Q_D(QEventTransition); d->registered = false; @@ -167,7 +167,7 @@ QEventTransition::QEventTransition(QObject *object, QEvent::Type type, \internal */ QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QState *parent) - : QTransition(dd, parent) + : QActionTransition(dd, parent) { } @@ -176,7 +176,7 @@ QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QState *parent) */ QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QObject *object, QEvent::Type type, QState *parent) - : QTransition(dd, parent) + : QActionTransition(dd, parent) { Q_D(QEventTransition); d->registered = false; @@ -190,7 +190,7 @@ QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QObject *object, QEventTransition::QEventTransition(QEventTransitionPrivate &dd, QObject *object, QEvent::Type type, const QList<QAbstractState*> &targets, QState *parent) - : QTransition(dd, targets, parent) + : QActionTransition(dd, targets, parent) { Q_D(QEventTransition); d->registered = false; @@ -286,7 +286,7 @@ bool QEventTransition::testEventCondition(QEvent *event) const */ bool QEventTransition::event(QEvent *e) { - return QTransition::event(e); + return QActionTransition::event(e); } QT_END_NAMESPACE diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h index edd7f8a..21a696c 100644 --- a/src/corelib/statemachine/qeventtransition.h +++ b/src/corelib/statemachine/qeventtransition.h @@ -42,7 +42,11 @@ #ifndef QEVENTTRANSITION_H #define QEVENTTRANSITION_H -#include "qtransition.h" +#ifndef QT_STATEMACHINE_SOLUTION +#include <QtCore/qactiontransition.h> +#else +#include "qactiontransition.h" +#endif #include <QtCore/qcoreevent.h> QT_BEGIN_HEADER @@ -52,7 +56,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) class QEventTransitionPrivate; -class Q_CORE_EXPORT QEventTransition : public QTransition +class Q_CORE_EXPORT QEventTransition : public QActionTransition { Q_OBJECT Q_PROPERTY(QObject* object READ eventSource WRITE setEventSource) diff --git a/src/corelib/statemachine/qeventtransition_p.h b/src/corelib/statemachine/qeventtransition_p.h index 568e35e..2bb5aaa 100644 --- a/src/corelib/statemachine/qeventtransition_p.h +++ b/src/corelib/statemachine/qeventtransition_p.h @@ -53,12 +53,12 @@ // We mean it. // -#include "qtransition_p.h" +#include "qactiontransition_p.h" QT_BEGIN_NAMESPACE class QEventTransition; -class Q_CORE_EXPORT QEventTransitionPrivate : public QTransitionPrivate +class Q_CORE_EXPORT QEventTransitionPrivate : public QActionTransitionPrivate { Q_DECLARE_PUBLIC(QEventTransition) public: diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp index 64e2952..32f2d02 100644 --- a/src/corelib/statemachine/qsignaltransition.cpp +++ b/src/corelib/statemachine/qsignaltransition.cpp @@ -137,7 +137,7 @@ void QSignalTransitionPrivate::invalidate() Constructs a new signal transition with the given \a sourceState. */ QSignalTransition::QSignalTransition(QState *sourceState) - : QTransition(*new QSignalTransitionPrivate, sourceState) + : QActionTransition(*new QSignalTransitionPrivate, sourceState) { } @@ -147,7 +147,7 @@ QSignalTransition::QSignalTransition(QState *sourceState) */ QSignalTransition::QSignalTransition(QObject *sender, const char *signal, QState *sourceState) - : QTransition(*new QSignalTransitionPrivate, sourceState) + : QActionTransition(*new QSignalTransitionPrivate, sourceState) { Q_D(QSignalTransition); d->sender = sender; @@ -162,7 +162,7 @@ QSignalTransition::QSignalTransition(QObject *sender, const char *signal, QSignalTransition::QSignalTransition(QObject *sender, const char *signal, const QList<QAbstractState*> &targets, QState *sourceState) - : QTransition(*new QSignalTransitionPrivate, targets, sourceState) + : QActionTransition(*new QSignalTransitionPrivate, targets, sourceState) { Q_D(QSignalTransition); d->sender = sender; @@ -247,7 +247,7 @@ bool QSignalTransition::eventTest(QEvent *event) const */ bool QSignalTransition::event(QEvent *e) { - return QTransition::event(e); + return QActionTransition::event(e); } QT_END_NAMESPACE diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h index ba4af17..c1a41ae 100644 --- a/src/corelib/statemachine/qsignaltransition.h +++ b/src/corelib/statemachine/qsignaltransition.h @@ -43,9 +43,9 @@ #define QSIGNALTRANSITION_H #ifndef QT_STATEMACHINE_SOLUTION -#include <QtCore/qtransition.h> +#include <QtCore/qactiontransition.h> #else -#include "qtransition.h" +#include "qactiontransition.h" #endif QT_BEGIN_HEADER @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) class QSignalTransitionPrivate; -class Q_CORE_EXPORT QSignalTransition : public QTransition +class Q_CORE_EXPORT QSignalTransition : public QActionTransition { Q_OBJECT Q_PROPERTY(QObject* object READ senderObject WRITE setSenderObject) diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h index c5fbcfc..bd815d9 100644 --- a/src/corelib/statemachine/qsignaltransition_p.h +++ b/src/corelib/statemachine/qsignaltransition_p.h @@ -53,12 +53,12 @@ // We mean it. // -#include "qtransition_p.h" +#include "qactiontransition_p.h" QT_BEGIN_NAMESPACE class QSignalTransition; -class QSignalTransitionPrivate : public QTransitionPrivate +class QSignalTransitionPrivate : public QActionTransitionPrivate { Q_DECLARE_PUBLIC(QSignalTransition) public: diff --git a/src/corelib/statemachine/qstatefinishedtransition.cpp b/src/corelib/statemachine/qstatefinishedtransition.cpp index 24d2ca4..33c3d22 100644 --- a/src/corelib/statemachine/qstatefinishedtransition.cpp +++ b/src/corelib/statemachine/qstatefinishedtransition.cpp @@ -41,7 +41,7 @@ #include "qstatefinishedtransition.h" #include "qstatefinishedevent.h" -#include "qtransition_p.h" +#include "qactiontransition_p.h" QT_BEGIN_NAMESPACE @@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE \brief the state whose QStateFinishedEvent this transition is associated with */ -class QStateFinishedTransitionPrivate : public QTransitionPrivate +class QStateFinishedTransitionPrivate : public QActionTransitionPrivate { Q_DECLARE_PUBLIC(QStateFinishedTransition) public: @@ -106,7 +106,7 @@ QStateFinishedTransitionPrivate *QStateFinishedTransitionPrivate::get(QStateFini sourceState. */ QStateFinishedTransition::QStateFinishedTransition(QState *sourceState) - : QTransition(*new QStateFinishedTransitionPrivate, sourceState) + : QActionTransition(*new QStateFinishedTransitionPrivate, sourceState) { } @@ -116,7 +116,7 @@ QStateFinishedTransition::QStateFinishedTransition(QState *sourceState) */ QStateFinishedTransition::QStateFinishedTransition( QState *state, const QList<QAbstractState*> &targets, QState *sourceState) - : QTransition(*new QStateFinishedTransitionPrivate, targets, sourceState) + : QActionTransition(*new QStateFinishedTransitionPrivate, targets, sourceState) { Q_D(QStateFinishedTransition); d->state = state; @@ -169,7 +169,7 @@ bool QStateFinishedTransition::eventTest(QEvent *event) const */ bool QStateFinishedTransition::event(QEvent *e) { - return QTransition::event(e); + return QActionTransition::event(e); } QT_END_NAMESPACE diff --git a/src/corelib/statemachine/qstatefinishedtransition.h b/src/corelib/statemachine/qstatefinishedtransition.h index eae3143..f9320f5 100644 --- a/src/corelib/statemachine/qstatefinishedtransition.h +++ b/src/corelib/statemachine/qstatefinishedtransition.h @@ -43,9 +43,9 @@ #define QSTATEFINISHEDTRANSITION_H #ifndef QT_STATEMACHINE_SOLUTION -#include <QtCore/qtransition.h> +#include <QtCore/qactiontransition.h> #else -#include "qtransition.h" +#include "qactiontransition.h" #endif QT_BEGIN_HEADER @@ -57,7 +57,7 @@ QT_MODULE(Core) class QState; class QStateFinishedTransitionPrivate; -class Q_CORE_EXPORT QStateFinishedTransition : public QTransition +class Q_CORE_EXPORT QStateFinishedTransition : public QActionTransition { Q_OBJECT Q_PROPERTY(QState* state READ state WRITE setState) diff --git a/src/corelib/statemachine/statemachine.pri b/src/corelib/statemachine/statemachine.pri index 9c797e2..4179e45 100644 --- a/src/corelib/statemachine/statemachine.pri +++ b/src/corelib/statemachine/statemachine.pri @@ -14,8 +14,8 @@ HEADERS += $$PWD/qstatemachine.h \ $$PWD/qhistorystate_p.h \ $$PWD/qabstracttransition.h \ $$PWD/qabstracttransition_p.h \ - $$PWD/qtransition.h \ - $$PWD/qtransition_p.h \ + $$PWD/qactiontransition.h \ + $$PWD/qactiontransition_p.h \ $$PWD/qstatefinishedevent.h \ $$PWD/qstatefinishedtransition.h \ $$PWD/qsignalevent.h \ @@ -30,7 +30,7 @@ SOURCES += $$PWD/qstatemachine.cpp \ $$PWD/qfinalstate.cpp \ $$PWD/qhistorystate.cpp \ $$PWD/qabstracttransition.cpp \ - $$PWD/qtransition.cpp \ + $$PWD/qactiontransition.cpp \ $$PWD/qstatefinishedtransition.cpp \ $$PWD/qsignaltransition.cpp |