summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-25 22:09:36 (GMT)
commit11b9190a182c5f3c1055c100145b02a3975509ed (patch)
tree2c664ad92363204c320e23f9d1e6ca29505eaf2e /src/corelib/statemachine
parent03686225036ebfc5cf78e3fcc66f5810a140c7d2 (diff)
parent3671dbf34940e166b747b6f8f3f5758fd486073c (diff)
downloadQt-11b9190a182c5f3c1055c100145b02a3975509ed.zip
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.gz
Qt-11b9190a182c5f3c1055c100145b02a3975509ed.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts: src/declarative/graphicsitems/qdeclarativeitem.cpp
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r--src/corelib/statemachine/qstate.cpp18
-rw-r--r--src/corelib/statemachine/qstate.h3
2 files changed, 20 insertions, 1 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index b6b3281..69cca06 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -66,7 +66,8 @@ QT_BEGIN_NAMESPACE
states. QState is part of \l{The State Machine Framework}.
The addTransition() function adds a transition. The removeTransition()
- function removes a transition.
+ function removes a transition. The transitions() function returns the
+ state's outgoing transitions.
The assignProperty() function is used for defining property assignments that
should be performed when a state is entered.
@@ -408,6 +409,21 @@ void QState::removeTransition(QAbstractTransition *transition)
}
/*!
+ \since 4.7
+
+ Returns this state's outgoing transitions (i.e. transitions where
+ this state is the \l{QAbstractTransition::sourceState()}{source
+ state}), or an empty list if this state has no outgoing transitions.
+
+ \sa addTransition()
+*/
+QList<QAbstractTransition*> QState::transitions() const
+{
+ Q_D(const QState);
+ return d->transitions();
+}
+
+/*!
\reimp
*/
void QState::onEntry(QEvent *event)
diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h
index 782a2a6..620104f 100644
--- a/src/corelib/statemachine/qstate.h
+++ b/src/corelib/statemachine/qstate.h
@@ -44,6 +44,8 @@
#include <QtCore/qabstractstate.h>
+#include <QtCore/qlist.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -80,6 +82,7 @@ public:
QSignalTransition *addTransition(QObject *sender, const char *signal, QAbstractState *target);
QAbstractTransition *addTransition(QAbstractState *target);
void removeTransition(QAbstractTransition *transition);
+ QList<QAbstractTransition*> transitions() const;
QAbstractState *initialState() const;
void setInitialState(QAbstractState *state);