| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qstate.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||||||||||||||||||||
| 2 | ** | - | ||||||||||||||||||||||||
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||||||||||||||||||||
| 4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||||||||||||||||||||
| 5 | ** | - | ||||||||||||||||||||||||
| 6 | ** This file is part of the QtCore module of the Qt Toolkit. | - | ||||||||||||||||||||||||
| 7 | ** | - | ||||||||||||||||||||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||||||||||||||||||||
| 9 | ** Commercial License Usage | - | ||||||||||||||||||||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||||||||||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||||||||||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||||||||||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||||||||||||||
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||||||||||||||||||||
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||||||||||||||||||||
| 16 | ** | - | ||||||||||||||||||||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||||||||||||||||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||||||||||||||
| 19 | ** General Public License version 3 as published by the Free Software | - | ||||||||||||||||||||||||
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||||||||||||||||||||
| 21 | ** packaging of this file. Please review the following information to | - | ||||||||||||||||||||||||
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||||||||||||||||||||
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||||||||||||||||||||
| 24 | ** | - | ||||||||||||||||||||||||
| 25 | ** GNU General Public License Usage | - | ||||||||||||||||||||||||
| 26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||||||||||||||||||||
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||||||||||||||||||||
| 28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||||||||||||||||||||
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||||||||||||||||||||
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||||||||||||||||||||
| 31 | ** included in the packaging of this file. Please review the following | - | ||||||||||||||||||||||||
| 32 | ** information to ensure the GNU General Public License requirements will | - | ||||||||||||||||||||||||
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||||||||||||||||||||
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||||||||||||||||||||
| 35 | ** | - | ||||||||||||||||||||||||
| 36 | ** $QT_END_LICENSE$ | - | ||||||||||||||||||||||||
| 37 | ** | - | ||||||||||||||||||||||||
| 38 | ****************************************************************************/ | - | ||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||
| 40 | #include "qstate_p.h" | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | #ifndef QT_NO_STATEMACHINE | - | ||||||||||||||||||||||||
| 43 | - | |||||||||||||||||||||||||
| 44 | #include "qhistorystate.h" | - | ||||||||||||||||||||||||
| 45 | #include "qhistorystate_p.h" | - | ||||||||||||||||||||||||
| 46 | #include "qabstracttransition.h" | - | ||||||||||||||||||||||||
| 47 | #include "qabstracttransition_p.h" | - | ||||||||||||||||||||||||
| 48 | #include "qsignaltransition.h" | - | ||||||||||||||||||||||||
| 49 | #include "qstatemachine.h" | - | ||||||||||||||||||||||||
| 50 | #include "qstatemachine_p.h" | - | ||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | QT_BEGIN_NAMESPACE | - | ||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | /*! | - | ||||||||||||||||||||||||
| 55 | \class QState | - | ||||||||||||||||||||||||
| 56 | \inmodule QtCore | - | ||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | \brief The QState class provides a general-purpose state for QStateMachine. | - | ||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | \since 4.6 | - | ||||||||||||||||||||||||
| 61 | \ingroup statemachine | - | ||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | QState objects can have child states, and can have transitions to other | - | ||||||||||||||||||||||||
| 64 | states. QState is part of \l{The State Machine Framework}. | - | ||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | The addTransition() function adds a transition. The removeTransition() | - | ||||||||||||||||||||||||
| 67 | function removes a transition. The transitions() function returns the | - | ||||||||||||||||||||||||
| 68 | state's outgoing transitions. | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | The assignProperty() function is used for defining property assignments that | - | ||||||||||||||||||||||||
| 71 | should be performed when a state is entered. | - | ||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | Top-level states must be passed a QStateMachine object as their parent | - | ||||||||||||||||||||||||
| 74 | state, or added to a state machine using QStateMachine::addState(). | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | \section1 States with Child States | - | ||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||
| 78 | The childMode property determines how child states are treated. For | - | ||||||||||||||||||||||||
| 79 | non-parallel state groups, the setInitialState() function must be called to | - | ||||||||||||||||||||||||
| 80 | set the initial state. The child states are mutually exclusive states, and | - | ||||||||||||||||||||||||
| 81 | the state machine needs to know which child state to enter when the parent | - | ||||||||||||||||||||||||
| 82 | state is the target of a transition. | - | ||||||||||||||||||||||||
| 83 | - | |||||||||||||||||||||||||
| 84 | The state emits the QState::finished() signal when a final child state | - | ||||||||||||||||||||||||
| 85 | (QFinalState) is entered. | - | ||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||
| 87 | The setErrorState() sets the state's error state. The error state is the | - | ||||||||||||||||||||||||
| 88 | state that the state machine will transition to if an error is detected when | - | ||||||||||||||||||||||||
| 89 | attempting to enter the state (e.g. because no initial state has been set). | - | ||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||
| 91 | */ | - | ||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||
| 93 | /*! | - | ||||||||||||||||||||||||
| 94 | \property QState::initialState | - | ||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 | \brief the initial state of this state (one of its child states) | - | ||||||||||||||||||||||||
| 97 | */ | - | ||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||
| 99 | /*! | - | ||||||||||||||||||||||||
| 100 | \property QState::errorState | - | ||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | \brief the error state of this state | - | ||||||||||||||||||||||||
| 103 | */ | - | ||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | /*! | - | ||||||||||||||||||||||||
| 106 | \property QState::childMode | - | ||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||
| 108 | \brief the child mode of this state | - | ||||||||||||||||||||||||
| 109 | - | |||||||||||||||||||||||||
| 110 | The default value of this property is QState::ExclusiveStates. | - | ||||||||||||||||||||||||
| 111 | */ | - | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | /*! | - | ||||||||||||||||||||||||
| 114 | \enum QState::ChildMode | - | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | This enum specifies how a state's child states are treated. | - | ||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||
| 118 | \value ExclusiveStates The child states are mutually exclusive and an | - | ||||||||||||||||||||||||
| 119 | initial state must be set by calling QState::setInitialState(). | - | ||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||
| 121 | \value ParallelStates The child states are parallel. When the parent state | - | ||||||||||||||||||||||||
| 122 | is entered, all its child states are entered in parallel. | - | ||||||||||||||||||||||||
| 123 | */ | - | ||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||
| 125 | /*! | - | ||||||||||||||||||||||||
| 126 | \enum QState::RestorePolicy | - | ||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | This enum specifies the restore policy type. The restore policy | - | ||||||||||||||||||||||||
| 129 | takes effect when the machine enters a state which sets one or more | - | ||||||||||||||||||||||||
| 130 | properties. If the restore policy is set to RestoreProperties, | - | ||||||||||||||||||||||||
| 131 | the state machine will save the original value of the property before the | - | ||||||||||||||||||||||||
| 132 | new value is set. | - | ||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | Later, when the machine either enters a state which does not set | - | ||||||||||||||||||||||||
| 135 | a value for the given property, the property will automatically be restored | - | ||||||||||||||||||||||||
| 136 | to its initial value. | - | ||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | Only one initial value will be saved for any given property. If a value for a property has | - | ||||||||||||||||||||||||
| 139 | already been saved by the state machine, it will not be overwritten until the property has been | - | ||||||||||||||||||||||||
| 140 | successfully restored. | - | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | \value DontRestoreProperties The state machine should not save the initial values of properties | - | ||||||||||||||||||||||||
| 143 | and restore them later. | - | ||||||||||||||||||||||||
| 144 | \value RestoreProperties The state machine should save the initial values of properties | - | ||||||||||||||||||||||||
| 145 | and restore them later. | - | ||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||
| 147 | \sa QStateMachine::globalRestorePolicy, QState::assignProperty() | - | ||||||||||||||||||||||||
| 148 | */ | - | ||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||
| 150 | QStatePrivate::QStatePrivate() | - | ||||||||||||||||||||||||
| 151 | : QAbstractStatePrivate(StandardState), | - | ||||||||||||||||||||||||
| 152 | errorState(0), initialState(0), childMode(QState::ExclusiveStates), | - | ||||||||||||||||||||||||
| 153 | childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true) | - | ||||||||||||||||||||||||
| 154 | { | - | ||||||||||||||||||||||||
| 155 | } executed 539 times by 2 tests: end of blockExecuted by:
| 539 | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | QStatePrivate::~QStatePrivate() | - | ||||||||||||||||||||||||
| 158 | { | - | ||||||||||||||||||||||||
| 159 | } | - | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | void QStatePrivate::emitFinished() | - | ||||||||||||||||||||||||
| 162 | { | - | ||||||||||||||||||||||||
| 163 | Q_Q(QState); | - | ||||||||||||||||||||||||
| 164 | emit q->finished(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 165 | } executed 74 times by 1 test: end of blockExecuted by:
| 74 | ||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||
| 167 | void QStatePrivate::emitPropertiesAssigned() | - | ||||||||||||||||||||||||
| 168 | { | - | ||||||||||||||||||||||||
| 169 | Q_Q(QState); | - | ||||||||||||||||||||||||
| 170 | emit q->propertiesAssigned(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 171 | } executed 1415 times by 2 tests: end of blockExecuted by:
| 1415 | ||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | /*! | - | ||||||||||||||||||||||||
| 174 | Constructs a new state with the given \a parent state. | - | ||||||||||||||||||||||||
| 175 | */ | - | ||||||||||||||||||||||||
| 176 | QState::QState(QState *parent) | - | ||||||||||||||||||||||||
| 177 | : QAbstractState(*new QStatePrivate, parent) | - | ||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||
| 179 | } executed 378 times by 2 tests: end of blockExecuted by:
| 378 | ||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||
| 181 | /*! | - | ||||||||||||||||||||||||
| 182 | Constructs a new state with the given \a childMode and the given \a parent | - | ||||||||||||||||||||||||
| 183 | state. | - | ||||||||||||||||||||||||
| 184 | */ | - | ||||||||||||||||||||||||
| 185 | QState::QState(ChildMode childMode, QState *parent) | - | ||||||||||||||||||||||||
| 186 | : QAbstractState(*new QStatePrivate, parent) | - | ||||||||||||||||||||||||
| 187 | { | - | ||||||||||||||||||||||||
| 188 | Q_D(QState); | - | ||||||||||||||||||||||||
| 189 | d->childMode = childMode; | - | ||||||||||||||||||||||||
| 190 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||
| 192 | /*! | - | ||||||||||||||||||||||||
| 193 | \internal | - | ||||||||||||||||||||||||
| 194 | */ | - | ||||||||||||||||||||||||
| 195 | QState::QState(QStatePrivate &dd, QState *parent) | - | ||||||||||||||||||||||||
| 196 | : QAbstractState(dd, parent) | - | ||||||||||||||||||||||||
| 197 | { | - | ||||||||||||||||||||||||
| 198 | } executed 145 times by 2 tests: end of blockExecuted by:
| 145 | ||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||
| 200 | /*! | - | ||||||||||||||||||||||||
| 201 | Destroys this state. | - | ||||||||||||||||||||||||
| 202 | */ | - | ||||||||||||||||||||||||
| 203 | QState::~QState() | - | ||||||||||||||||||||||||
| 204 | { | - | ||||||||||||||||||||||||
| 205 | } | - | ||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | QList<QAbstractState*> QStatePrivate::childStates() const | - | ||||||||||||||||||||||||
| 208 | { | - | ||||||||||||||||||||||||
| 209 | if (childStatesListNeedsRefresh) {
| 548-7102 | ||||||||||||||||||||||||
| 210 | childStatesList.clear(); | - | ||||||||||||||||||||||||
| 211 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||
| 212 | for (it = children.constBegin(); it != children.constEnd(); ++it) {
| 548-891 | ||||||||||||||||||||||||
| 213 | QAbstractState *s = qobject_cast<QAbstractState*>(*it); | - | ||||||||||||||||||||||||
| 214 | if (!s || qobject_cast<QHistoryState*>(s))
| 8-563 | ||||||||||||||||||||||||
| 215 | continue; executed 336 times by 2 tests: continue;Executed by:
| 336 | ||||||||||||||||||||||||
| 216 | childStatesList.append(s); | - | ||||||||||||||||||||||||
| 217 | } executed 555 times by 2 tests: end of blockExecuted by:
| 555 | ||||||||||||||||||||||||
| 218 | childStatesListNeedsRefresh = false; | - | ||||||||||||||||||||||||
| 219 | } executed 548 times by 2 tests: end of blockExecuted by:
| 548 | ||||||||||||||||||||||||
| 220 | return childStatesList; executed 7650 times by 2 tests: return childStatesList;Executed by:
| 7650 | ||||||||||||||||||||||||
| 221 | } | - | ||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||
| 223 | QList<QHistoryState*> QStatePrivate::historyStates() const | - | ||||||||||||||||||||||||
| 224 | { | - | ||||||||||||||||||||||||
| 225 | QList<QHistoryState*> result; | - | ||||||||||||||||||||||||
| 226 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||
| 227 | for (it = children.constBegin(); it != children.constEnd(); ++it) {
| 1291-2438 | ||||||||||||||||||||||||
| 228 | QHistoryState *h = qobject_cast<QHistoryState*>(*it); | - | ||||||||||||||||||||||||
| 229 | if (h)
| 9-2429 | ||||||||||||||||||||||||
| 230 | result.append(h); executed 9 times by 2 tests: result.append(h);Executed by:
| 9 | ||||||||||||||||||||||||
| 231 | } executed 2438 times by 2 tests: end of blockExecuted by:
| 2438 | ||||||||||||||||||||||||
| 232 | return result; executed 1291 times by 2 tests: return result;Executed by:
| 1291 | ||||||||||||||||||||||||
| 233 | } | - | ||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||
| 235 | QList<QAbstractTransition*> QStatePrivate::transitions() const | - | ||||||||||||||||||||||||
| 236 | { | - | ||||||||||||||||||||||||
| 237 | if (transitionsListNeedsRefresh) {
| 505-7842 | ||||||||||||||||||||||||
| 238 | transitionsList.clear(); | - | ||||||||||||||||||||||||
| 239 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||
| 240 | for (it = children.constBegin(); it != children.constEnd(); ++it) {
| 505-808 | ||||||||||||||||||||||||
| 241 | QAbstractTransition *t = qobject_cast<QAbstractTransition*>(*it); | - | ||||||||||||||||||||||||
| 242 | if (t)
| 240-568 | ||||||||||||||||||||||||
| 243 | transitionsList.append(t); executed 240 times by 2 tests: transitionsList.append(t);Executed by:
| 240 | ||||||||||||||||||||||||
| 244 | } executed 808 times by 2 tests: end of blockExecuted by:
| 808 | ||||||||||||||||||||||||
| 245 | transitionsListNeedsRefresh = false; | - | ||||||||||||||||||||||||
| 246 | } executed 505 times by 2 tests: end of blockExecuted by:
| 505 | ||||||||||||||||||||||||
| 247 | return transitionsList; executed 8347 times by 2 tests: return transitionsList;Executed by:
| 8347 | ||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | #ifndef QT_NO_PROPERTIES | - | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | /*! | - | ||||||||||||||||||||||||
| 253 | Instructs this state to set the property with the given \a name of the given | - | ||||||||||||||||||||||||
| 254 | \a object to the given \a value when the state is entered. | - | ||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||
| 256 | \sa propertiesAssigned() | - | ||||||||||||||||||||||||
| 257 | */ | - | ||||||||||||||||||||||||
| 258 | void QState::assignProperty(QObject *object, const char *name, | - | ||||||||||||||||||||||||
| 259 | const QVariant &value) | - | ||||||||||||||||||||||||
| 260 | { | - | ||||||||||||||||||||||||
| 261 | Q_D(QState); | - | ||||||||||||||||||||||||
| 262 | if (!object) {
| 1-103 | ||||||||||||||||||||||||
| 263 | qWarning("QState::assignProperty: cannot assign property '%s' of null object", name); | - | ||||||||||||||||||||||||
| 264 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||
| 265 | } | - | ||||||||||||||||||||||||
| 266 | for (int i = 0; i < d->propertyAssignments.size(); ++i) {
| 15-101 | ||||||||||||||||||||||||
| 267 | QPropertyAssignment &assn = d->propertyAssignments[i]; | - | ||||||||||||||||||||||||
| 268 | if (assn.hasTarget(object, name)) {
| 2-13 | ||||||||||||||||||||||||
| 269 | assn.value = value; | - | ||||||||||||||||||||||||
| 270 | return; executed 2 times by 2 tests: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 271 | } | - | ||||||||||||||||||||||||
| 272 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||
| 273 | d->propertyAssignments.append(QPropertyAssignment(object, name, value)); | - | ||||||||||||||||||||||||
| 274 | } executed 101 times by 2 tests: end of blockExecuted by:
| 101 | ||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||
| 276 | #endif // QT_NO_PROPERTIES | - | ||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||
| 278 | /*! | - | ||||||||||||||||||||||||
| 279 | Returns this state's error state. | - | ||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||
| 281 | \sa QStateMachine::error() | - | ||||||||||||||||||||||||
| 282 | */ | - | ||||||||||||||||||||||||
| 283 | QAbstractState *QState::errorState() const | - | ||||||||||||||||||||||||
| 284 | { | - | ||||||||||||||||||||||||
| 285 | Q_D(const QState); | - | ||||||||||||||||||||||||
| 286 | return d->errorState; executed 44 times by 1 test: return d->errorState;Executed by:
| 44 | ||||||||||||||||||||||||
| 287 | } | - | ||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||
| 289 | /*! | - | ||||||||||||||||||||||||
| 290 | Sets this state's error state to be the given \a state. If the error state | - | ||||||||||||||||||||||||
| 291 | is not set, or if it is set to 0, the state will inherit its parent's error | - | ||||||||||||||||||||||||
| 292 | state recursively. If no error state is set for the state itself or any of | - | ||||||||||||||||||||||||
| 293 | its ancestors, an error will cause the machine to stop executing and an error | - | ||||||||||||||||||||||||
| 294 | will be printed to the console. | - | ||||||||||||||||||||||||
| 295 | */ | - | ||||||||||||||||||||||||
| 296 | void QState::setErrorState(QAbstractState *state) | - | ||||||||||||||||||||||||
| 297 | { | - | ||||||||||||||||||||||||
| 298 | Q_D(QState); | - | ||||||||||||||||||||||||
| 299 | if (state != 0 && qobject_cast<QStateMachine*>(state)) {
| 1-14 | ||||||||||||||||||||||||
| 300 | qWarning("QStateMachine::setErrorState: root state cannot be error state"); | - | ||||||||||||||||||||||||
| 301 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||
| 302 | } | - | ||||||||||||||||||||||||
| 303 | if (state != 0 && (!state->machine() || ((state->machine() != machine()) && !qobject_cast<QStateMachine*>(this)))) {
| 1-13 | ||||||||||||||||||||||||
| 304 | qWarning("QState::setErrorState: error state cannot belong " | - | ||||||||||||||||||||||||
| 305 | "to a different state machine"); | - | ||||||||||||||||||||||||
| 306 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 307 | } | - | ||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | if (d->errorState != state) {
| 1-11 | ||||||||||||||||||||||||
| 310 | d->errorState = state; | - | ||||||||||||||||||||||||
| 311 | emit errorStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 312 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||||||||||||||
| 313 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||
| 315 | /*! | - | ||||||||||||||||||||||||
| 316 | Adds the given \a transition. The transition has this state as the source. | - | ||||||||||||||||||||||||
| 317 | This state takes ownership of the transition. | - | ||||||||||||||||||||||||
| 318 | */ | - | ||||||||||||||||||||||||
| 319 | void QState::addTransition(QAbstractTransition *transition) | - | ||||||||||||||||||||||||
| 320 | { | - | ||||||||||||||||||||||||
| 321 | Q_D(QState); | - | ||||||||||||||||||||||||
| 322 | if (!transition) {
| 1-233 | ||||||||||||||||||||||||
| 323 | qWarning("QState::addTransition: cannot add null transition"); | - | ||||||||||||||||||||||||
| 324 | return ; executed 1 time by 1 test: return ;Executed by:
| 1 | ||||||||||||||||||||||||
| 325 | } | - | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | transition->setParent(this); | - | ||||||||||||||||||||||||
| 328 | const QVector<QPointer<QAbstractState> > &targets = QAbstractTransitionPrivate::get(transition)->targetStates; | - | ||||||||||||||||||||||||
| 329 | for (int i = 0; i < targets.size(); ++i) {
| 224-233 | ||||||||||||||||||||||||
| 330 | QAbstractState *t = targets.at(i).data(); | - | ||||||||||||||||||||||||
| 331 | if (!t) {
| 0-224 | ||||||||||||||||||||||||
| 332 | qWarning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||
| 333 | return ; never executed: return ; | 0 | ||||||||||||||||||||||||
| 334 | } | - | ||||||||||||||||||||||||
| 335 | if ((QAbstractStatePrivate::get(t)->machine() != d->machine())
| 4-220 | ||||||||||||||||||||||||
| 336 | && QAbstractStatePrivate::get(t)->machine() && d->machine()) {
| 0-3 | ||||||||||||||||||||||||
| 337 | qWarning("QState::addTransition: cannot add transition " | - | ||||||||||||||||||||||||
| 338 | "to a state in a different state machine"); | - | ||||||||||||||||||||||||
| 339 | return ; never executed: return ; | 0 | ||||||||||||||||||||||||
| 340 | } | - | ||||||||||||||||||||||||
| 341 | } executed 224 times by 2 tests: end of blockExecuted by:
| 224 | ||||||||||||||||||||||||
| 342 | if (QStateMachine *mach = machine())
| 9-224 | ||||||||||||||||||||||||
| 343 | QStateMachinePrivate::get(mach)->maybeRegisterTransition(transition); executed 224 times by 2 tests: QStateMachinePrivate::get(mach)->maybeRegisterTransition(transition);Executed by:
| 224 | ||||||||||||||||||||||||
| 344 | } executed 233 times by 2 tests: end of blockExecuted by:
| 233 | ||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | /*! | - | ||||||||||||||||||||||||
| 347 | \fn QState::addTransition(const QObject *sender, PointerToMemberFunction signal, | - | ||||||||||||||||||||||||
| 348 | QAbstractState *target); | - | ||||||||||||||||||||||||
| 349 | \since 5.5 | - | ||||||||||||||||||||||||
| 350 | \overload | - | ||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||
| 352 | Adds a transition associated with the given \a signal of the given \a sender | - | ||||||||||||||||||||||||
| 353 | object, and returns the new QSignalTransition object. The transition has | - | ||||||||||||||||||||||||
| 354 | this state as the source, and the given \a target as the target state. | - | ||||||||||||||||||||||||
| 355 | */ | - | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | /*! | - | ||||||||||||||||||||||||
| 358 | Adds a transition associated with the given \a signal of the given \a sender | - | ||||||||||||||||||||||||
| 359 | object, and returns the new QSignalTransition object. The transition has | - | ||||||||||||||||||||||||
| 360 | this state as the source, and the given \a target as the target state. | - | ||||||||||||||||||||||||
| 361 | */ | - | ||||||||||||||||||||||||
| 362 | QSignalTransition *QState::addTransition(const QObject *sender, const char *signal, | - | ||||||||||||||||||||||||
| 363 | QAbstractState *target) | - | ||||||||||||||||||||||||
| 364 | { | - | ||||||||||||||||||||||||
| 365 | if (!sender) {
| 1-64 | ||||||||||||||||||||||||
| 366 | qWarning("QState::addTransition: sender cannot be null"); | - | ||||||||||||||||||||||||
| 367 | return 0; executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 368 | } | - | ||||||||||||||||||||||||
| 369 | if (!signal) {
| 1-63 | ||||||||||||||||||||||||
| 370 | qWarning("QState::addTransition: signal cannot be null"); | - | ||||||||||||||||||||||||
| 371 | return 0; executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 372 | } | - | ||||||||||||||||||||||||
| 373 | if (!target) {
| 1-62 | ||||||||||||||||||||||||
| 374 | qWarning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||
| 375 | return 0; executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 376 | } | - | ||||||||||||||||||||||||
| 377 | int offset = (*signal == '0'+QSIGNAL_CODE) ? 1 : 0;
| 2-60 | ||||||||||||||||||||||||
| 378 | const QMetaObject *meta = sender->metaObject(); | - | ||||||||||||||||||||||||
| 379 | if (meta->indexOfSignal(signal+offset) == -1) {
| 1-61 | ||||||||||||||||||||||||
| 380 | if (meta->indexOfSignal(QMetaObject::normalizedSignature(signal+offset)) == -1) {
| 0-1 | ||||||||||||||||||||||||
| 381 | qWarning("QState::addTransition: no such signal %s::%s", | - | ||||||||||||||||||||||||
| 382 | meta->className(), signal+offset); | - | ||||||||||||||||||||||||
| 383 | return 0; executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 384 | } | - | ||||||||||||||||||||||||
| 385 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 386 | QSignalTransition *trans = new QSignalTransition(sender, signal); | - | ||||||||||||||||||||||||
| 387 | trans->setTargetState(target); | - | ||||||||||||||||||||||||
| 388 | addTransition(trans); | - | ||||||||||||||||||||||||
| 389 | return trans; executed 61 times by 2 tests: return trans;Executed by:
| 61 | ||||||||||||||||||||||||
| 390 | } | - | ||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||
| 392 | namespace { | - | ||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||
| 394 | // ### Make public? | - | ||||||||||||||||||||||||
| 395 | class UnconditionalTransition : public QAbstractTransition | - | ||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||
| 397 | public: | - | ||||||||||||||||||||||||
| 398 | UnconditionalTransition(QAbstractState *target) | - | ||||||||||||||||||||||||
| 399 | : QAbstractTransition() | - | ||||||||||||||||||||||||
| 400 | { setTargetState(target); } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 401 | protected: | - | ||||||||||||||||||||||||
| 402 | void onTransition(QEvent *) Q_DECL_OVERRIDE {} | - | ||||||||||||||||||||||||
| 403 | bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; } executed 19 times by 1 test: return true;Executed by:
| 19 | ||||||||||||||||||||||||
| 404 | }; | - | ||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||
| 406 | } // namespace | - | ||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | /*! | - | ||||||||||||||||||||||||
| 409 | Adds an unconditional transition from this state to the given \a target | - | ||||||||||||||||||||||||
| 410 | state, and returns then new transition object. | - | ||||||||||||||||||||||||
| 411 | */ | - | ||||||||||||||||||||||||
| 412 | QAbstractTransition *QState::addTransition(QAbstractState *target) | - | ||||||||||||||||||||||||
| 413 | { | - | ||||||||||||||||||||||||
| 414 | if (!target) {
| 1-16 | ||||||||||||||||||||||||
| 415 | qWarning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||
| 416 | return 0; executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||
| 417 | } | - | ||||||||||||||||||||||||
| 418 | UnconditionalTransition *trans = new UnconditionalTransition(target); | - | ||||||||||||||||||||||||
| 419 | addTransition(trans); | - | ||||||||||||||||||||||||
| 420 | return trans; executed 16 times by 1 test: return trans;Executed by:
| 16 | ||||||||||||||||||||||||
| 421 | } | - | ||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | /*! | - | ||||||||||||||||||||||||
| 424 | Removes the given \a transition from this state. The state releases | - | ||||||||||||||||||||||||
| 425 | ownership of the transition. | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | \sa addTransition() | - | ||||||||||||||||||||||||
| 428 | */ | - | ||||||||||||||||||||||||
| 429 | void QState::removeTransition(QAbstractTransition *transition) | - | ||||||||||||||||||||||||
| 430 | { | - | ||||||||||||||||||||||||
| 431 | Q_D(QState); | - | ||||||||||||||||||||||||
| 432 | if (!transition) {
| 1-8 | ||||||||||||||||||||||||
| 433 | qWarning("QState::removeTransition: cannot remove null transition"); | - | ||||||||||||||||||||||||
| 434 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||
| 436 | if (transition->sourceState() != this) {
| 1-7 | ||||||||||||||||||||||||
| 437 | qWarning("QState::removeTransition: transition %p's source state (%p)" | - | ||||||||||||||||||||||||
| 438 | " is different from this state (%p)", | - | ||||||||||||||||||||||||
| 439 | transition, transition->sourceState(), this); | - | ||||||||||||||||||||||||
| 440 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||
| 441 | } | - | ||||||||||||||||||||||||
| 442 | QStateMachinePrivate *mach = QStateMachinePrivate::get(d->machine()); | - | ||||||||||||||||||||||||
| 443 | if (mach)
| 2-5 | ||||||||||||||||||||||||
| 444 | mach->unregisterTransition(transition); executed 5 times by 1 test: mach->unregisterTransition(transition);Executed by:
| 5 | ||||||||||||||||||||||||
| 445 | transition->setParent(0); | - | ||||||||||||||||||||||||
| 446 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | /*! | - | ||||||||||||||||||||||||
| 449 | \since 4.7 | - | ||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | Returns this state's outgoing transitions (i.e. transitions where | - | ||||||||||||||||||||||||
| 452 | this state is the \l{QAbstractTransition::sourceState()}{source | - | ||||||||||||||||||||||||
| 453 | state}), or an empty list if this state has no outgoing transitions. | - | ||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||
| 455 | \sa addTransition() | - | ||||||||||||||||||||||||
| 456 | */ | - | ||||||||||||||||||||||||
| 457 | QList<QAbstractTransition*> QState::transitions() const | - | ||||||||||||||||||||||||
| 458 | { | - | ||||||||||||||||||||||||
| 459 | Q_D(const QState); | - | ||||||||||||||||||||||||
| 460 | return d->transitions(); executed 14 times by 1 test: return d->transitions();Executed by:
| 14 | ||||||||||||||||||||||||
| 461 | } | - | ||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||
| 463 | /*! | - | ||||||||||||||||||||||||
| 464 | \reimp | - | ||||||||||||||||||||||||
| 465 | */ | - | ||||||||||||||||||||||||
| 466 | void QState::onEntry(QEvent *event) | - | ||||||||||||||||||||||||
| 467 | { | - | ||||||||||||||||||||||||
| 468 | Q_UNUSED(event); | - | ||||||||||||||||||||||||
| 469 | } executed 412 times by 2 tests: end of blockExecuted by:
| 412 | ||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | /*! | - | ||||||||||||||||||||||||
| 472 | \reimp | - | ||||||||||||||||||||||||
| 473 | */ | - | ||||||||||||||||||||||||
| 474 | void QState::onExit(QEvent *event) | - | ||||||||||||||||||||||||
| 475 | { | - | ||||||||||||||||||||||||
| 476 | Q_UNUSED(event); | - | ||||||||||||||||||||||||
| 477 | } executed 277 times by 2 tests: end of blockExecuted by:
| 277 | ||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||
| 479 | /*! | - | ||||||||||||||||||||||||
| 480 | Returns this state's initial state, or 0 if the state has no initial state. | - | ||||||||||||||||||||||||
| 481 | */ | - | ||||||||||||||||||||||||
| 482 | QAbstractState *QState::initialState() const | - | ||||||||||||||||||||||||
| 483 | { | - | ||||||||||||||||||||||||
| 484 | Q_D(const QState); | - | ||||||||||||||||||||||||
| 485 | return d->initialState; executed 382 times by 2 tests: return d->initialState;Executed by:
| 382 | ||||||||||||||||||||||||
| 486 | } | - | ||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||
| 488 | /*! | - | ||||||||||||||||||||||||
| 489 | Sets this state's initial state to be the given \a state. | - | ||||||||||||||||||||||||
| 490 | \a state has to be a child of this state. | - | ||||||||||||||||||||||||
| 491 | */ | - | ||||||||||||||||||||||||
| 492 | void QState::setInitialState(QAbstractState *state) | - | ||||||||||||||||||||||||
| 493 | { | - | ||||||||||||||||||||||||
| 494 | Q_D(QState); | - | ||||||||||||||||||||||||
| 495 | if (d->childMode == QState::ParallelStates) {
| 2-181 | ||||||||||||||||||||||||
| 496 | qWarning("QState::setInitialState: ignoring attempt to set initial state " | - | ||||||||||||||||||||||||
| 497 | "of parallel state group %p", this); | - | ||||||||||||||||||||||||
| 498 | return; executed 2 times by 2 tests: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 499 | } | - | ||||||||||||||||||||||||
| 500 | if (state && (state->parentState() != this)) {
| 0-181 | ||||||||||||||||||||||||
| 501 | qWarning("QState::setInitialState: state %p is not a child of this state (%p)", | - | ||||||||||||||||||||||||
| 502 | state, this); | - | ||||||||||||||||||||||||
| 503 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||
| 504 | } | - | ||||||||||||||||||||||||
| 505 | if (d->initialState != state) {
| 0-180 | ||||||||||||||||||||||||
| 506 | d->initialState = state; | - | ||||||||||||||||||||||||
| 507 | emit initialStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 508 | } executed 180 times by 2 tests: end of blockExecuted by:
| 180 | ||||||||||||||||||||||||
| 509 | } executed 180 times by 2 tests: end of blockExecuted by:
| 180 | ||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||
| 511 | /*! | - | ||||||||||||||||||||||||
| 512 | Returns the child mode of this state. | - | ||||||||||||||||||||||||
| 513 | */ | - | ||||||||||||||||||||||||
| 514 | QState::ChildMode QState::childMode() const | - | ||||||||||||||||||||||||
| 515 | { | - | ||||||||||||||||||||||||
| 516 | Q_D(const QState); | - | ||||||||||||||||||||||||
| 517 | return d->childMode; executed 390 times by 2 tests: return d->childMode;Executed by:
| 390 | ||||||||||||||||||||||||
| 518 | } | - | ||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||
| 520 | /*! | - | ||||||||||||||||||||||||
| 521 | Sets the child \a mode of this state. | - | ||||||||||||||||||||||||
| 522 | */ | - | ||||||||||||||||||||||||
| 523 | void QState::setChildMode(ChildMode mode) | - | ||||||||||||||||||||||||
| 524 | { | - | ||||||||||||||||||||||||
| 525 | Q_D(QState); | - | ||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||
| 527 | if (mode == QState::ParallelStates && d->initialState) {
| 1-5 | ||||||||||||||||||||||||
| 528 | qWarning("QState::setChildMode: setting the child-mode of state %p to " | - | ||||||||||||||||||||||||
| 529 | "parallel removes the initial state", this); | - | ||||||||||||||||||||||||
| 530 | d->initialState = Q_NULLPTR; | - | ||||||||||||||||||||||||
| 531 | emit initialStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 532 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||
| 534 | if (d->childMode != mode) {
| 0-6 | ||||||||||||||||||||||||
| 535 | d->childMode = mode; | - | ||||||||||||||||||||||||
| 536 | emit childModeChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||
| 537 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 538 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | /*! | - | ||||||||||||||||||||||||
| 541 | \reimp | - | ||||||||||||||||||||||||
| 542 | */ | - | ||||||||||||||||||||||||
| 543 | bool QState::event(QEvent *e) | - | ||||||||||||||||||||||||
| 544 | { | - | ||||||||||||||||||||||||
| 545 | Q_D(QState); | - | ||||||||||||||||||||||||
| 546 | if ((e->type() == QEvent::ChildAdded) || (e->type() == QEvent::ChildRemoved)) {
| 75-787 | ||||||||||||||||||||||||
| 547 | d->childStatesListNeedsRefresh = true; | - | ||||||||||||||||||||||||
| 548 | d->transitionsListNeedsRefresh = true; | - | ||||||||||||||||||||||||
| 549 | if ((e->type() == QEvent::ChildRemoved) && (static_cast<QChildEvent *>(e)->child() == d->initialState))
| 18-787 | ||||||||||||||||||||||||
| 550 | d->initialState = 0; executed 18 times by 1 test: d->initialState = 0;Executed by:
| 18 | ||||||||||||||||||||||||
| 551 | } executed 862 times by 2 tests: end of blockExecuted by:
| 862 | ||||||||||||||||||||||||
| 552 | return QAbstractState::event(e); executed 1156 times by 2 tests: return QAbstractState::event(e);Executed by:
| 1156 | ||||||||||||||||||||||||
| 553 | } | - | ||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||
| 555 | /*! | - | ||||||||||||||||||||||||
| 556 | \fn QState::finished() | - | ||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | This signal is emitted when a final child state of this state is entered. | - | ||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||
| 560 | \sa QFinalState | - | ||||||||||||||||||||||||
| 561 | */ | - | ||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||
| 563 | /*! | - | ||||||||||||||||||||||||
| 564 | \fn QState::propertiesAssigned() | - | ||||||||||||||||||||||||
| 565 | - | |||||||||||||||||||||||||
| 566 | This signal is emitted when all properties have been assigned their final value. If the state | - | ||||||||||||||||||||||||
| 567 | assigns a value to one or more properties for which an animation exists (either set on the | - | ||||||||||||||||||||||||
| 568 | transition or as a default animation on the state machine), then the signal will not be emitted | - | ||||||||||||||||||||||||
| 569 | until all such animations have finished playing. | - | ||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||
| 571 | If there are no relevant animations, or no property assignments defined for the state, then | - | ||||||||||||||||||||||||
| 572 | the signal will be emitted immediately before the state is entered. | - | ||||||||||||||||||||||||
| 573 | - | |||||||||||||||||||||||||
| 574 | \sa QState::assignProperty(), QAbstractTransition::addAnimation() | - | ||||||||||||||||||||||||
| 575 | */ | - | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 | /*! | - | ||||||||||||||||||||||||
| 578 | \fn QState::childModeChanged() | - | ||||||||||||||||||||||||
| 579 | \since 5.4 | - | ||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||
| 581 | This signal is emitted when the childMode property is changed. | - | ||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||
| 583 | \sa QState::childMode | - | ||||||||||||||||||||||||
| 584 | */ | - | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | /*! | - | ||||||||||||||||||||||||
| 587 | \fn QState::initialStateChanged() | - | ||||||||||||||||||||||||
| 588 | \since 5.4 | - | ||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||
| 590 | This signal is emitted when the initialState property is changed. | - | ||||||||||||||||||||||||
| 591 | - | |||||||||||||||||||||||||
| 592 | \sa QState::initialState | - | ||||||||||||||||||||||||
| 593 | */ | - | ||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||
| 595 | /*! | - | ||||||||||||||||||||||||
| 596 | \fn QState::errorStateChanged() | - | ||||||||||||||||||||||||
| 597 | \since 5.4 | - | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | This signal is emitted when the errorState property is changed. | - | ||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||
| 601 | \sa QState::errorState | - | ||||||||||||||||||||||||
| 602 | */ | - | ||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | QT_END_NAMESPACE | - | ||||||||||||||||||||||||
| 605 | - | |||||||||||||||||||||||||
| 606 | #endif //QT_NO_STATEMACHINE | - | ||||||||||||||||||||||||
| Source code | Switch to Preprocessed file |