| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qstate.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||
| 6 | QStatePrivate::QStatePrivate() | - | ||||||||||||||||||||||||||||||
| 7 | : QAbstractStatePrivate(StandardState), | - | ||||||||||||||||||||||||||||||
| 8 | errorState(0), initialState(0), childMode(QState::ExclusiveStates), | - | ||||||||||||||||||||||||||||||
| 9 | childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true) | - | ||||||||||||||||||||||||||||||
| 10 | { | - | ||||||||||||||||||||||||||||||
| 11 | } executed 539 times by 2 tests: end of blockExecuted by:
| 539 | ||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||
| 13 | QStatePrivate::~QStatePrivate() | - | ||||||||||||||||||||||||||||||
| 14 | { | - | ||||||||||||||||||||||||||||||
| 15 | } | - | ||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||
| 17 | void QStatePrivate::emitFinished() | - | ||||||||||||||||||||||||||||||
| 18 | { | - | ||||||||||||||||||||||||||||||
| 19 | QState * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 20 | q->finished(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 21 | } executed 74 times by 1 test: end of blockExecuted by:
| 74 | ||||||||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||||||||
| 23 | void QStatePrivate::emitPropertiesAssigned() | - | ||||||||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||||||||
| 25 | QState * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 26 | q->propertiesAssigned(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 27 | } executed 1415 times by 2 tests: end of blockExecuted by:
| 1415 | ||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||||||||
| 32 | QState::QState(QState *parent) | - | ||||||||||||||||||||||||||||||
| 33 | : QAbstractState(*new QStatePrivate, parent) | - | ||||||||||||||||||||||||||||||
| 34 | { | - | ||||||||||||||||||||||||||||||
| 35 | } executed 378 times by 2 tests: end of blockExecuted by:
| 378 | ||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||
| 41 | QState::QState(ChildMode childMode, QState *parent) | - | ||||||||||||||||||||||||||||||
| 42 | : QAbstractState(*new QStatePrivate, parent) | - | ||||||||||||||||||||||||||||||
| 43 | { | - | ||||||||||||||||||||||||||||||
| 44 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 45 | d->childMode = childMode; | - | ||||||||||||||||||||||||||||||
| 46 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||||||||
| 49 | - | |||||||||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||||||||
| 51 | QState::QState(QStatePrivate &dd, QState *parent) | - | ||||||||||||||||||||||||||||||
| 52 | : QAbstractState(dd, parent) | - | ||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||
| 54 | } executed 145 times by 2 tests: end of blockExecuted by:
| 145 | ||||||||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||
| 59 | QState::~QState() | - | ||||||||||||||||||||||||||||||
| 60 | { | - | ||||||||||||||||||||||||||||||
| 61 | } | - | ||||||||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||||||||
| 63 | QList<QAbstractState*> QStatePrivate::childStates() const | - | ||||||||||||||||||||||||||||||
| 64 | { | - | ||||||||||||||||||||||||||||||
| 65 | if (childStatesListNeedsRefresh
| 548-7102 | ||||||||||||||||||||||||||||||
| 66 | childStatesList.clear(); | - | ||||||||||||||||||||||||||||||
| 67 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||||||||
| 68 | for (it = children.constBegin(); it != children.constEnd()
| 548-891 | ||||||||||||||||||||||||||||||
| 69 | QAbstractState *s = qobject_cast<QAbstractState*>(*it); | - | ||||||||||||||||||||||||||||||
| 70 | if (!s
| 8-563 | ||||||||||||||||||||||||||||||
| 71 | continue; executed 336 times by 2 tests: continue;Executed by:
| 336 | ||||||||||||||||||||||||||||||
| 72 | childStatesList.append(s); | - | ||||||||||||||||||||||||||||||
| 73 | } executed 555 times by 2 tests: end of blockExecuted by:
| 555 | ||||||||||||||||||||||||||||||
| 74 | childStatesListNeedsRefresh = false; | - | ||||||||||||||||||||||||||||||
| 75 | } executed 548 times by 2 tests: end of blockExecuted by:
| 548 | ||||||||||||||||||||||||||||||
| 76 | return executed 7650 times by 2 tests: childStatesList;return childStatesList;Executed by:
executed 7650 times by 2 tests: return childStatesList;Executed by:
| 7650 | ||||||||||||||||||||||||||||||
| 77 | } | - | ||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||
| 79 | QList<QHistoryState*> QStatePrivate::historyStates() const | - | ||||||||||||||||||||||||||||||
| 80 | { | - | ||||||||||||||||||||||||||||||
| 81 | QList<QHistoryState*> result; | - | ||||||||||||||||||||||||||||||
| 82 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||||||||
| 83 | for (it = children.constBegin(); it != children.constEnd()
| 1291-2438 | ||||||||||||||||||||||||||||||
| 84 | QHistoryState *h = qobject_cast<QHistoryState*>(*it); | - | ||||||||||||||||||||||||||||||
| 85 | if (h
| 9-2429 | ||||||||||||||||||||||||||||||
| 86 | result.append(h); executed 9 times by 2 tests: result.append(h);Executed by:
| 9 | ||||||||||||||||||||||||||||||
| 87 | } executed 2438 times by 2 tests: end of blockExecuted by:
| 2438 | ||||||||||||||||||||||||||||||
| 88 | return executed 1291 times by 2 tests: result;return result;Executed by:
executed 1291 times by 2 tests: return result;Executed by:
| 1291 | ||||||||||||||||||||||||||||||
| 89 | } | - | ||||||||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||||||||
| 91 | QList<QAbstractTransition*> QStatePrivate::transitions() const | - | ||||||||||||||||||||||||||||||
| 92 | { | - | ||||||||||||||||||||||||||||||
| 93 | if (transitionsListNeedsRefresh
| 505-7842 | ||||||||||||||||||||||||||||||
| 94 | transitionsList.clear(); | - | ||||||||||||||||||||||||||||||
| 95 | QList<QObject*>::const_iterator it; | - | ||||||||||||||||||||||||||||||
| 96 | for (it = children.constBegin(); it != children.constEnd()
| 505-808 | ||||||||||||||||||||||||||||||
| 97 | QAbstractTransition *t = qobject_cast<QAbstractTransition*>(*it); | - | ||||||||||||||||||||||||||||||
| 98 | if (t
| 240-568 | ||||||||||||||||||||||||||||||
| 99 | transitionsList.append(t); executed 240 times by 2 tests: transitionsList.append(t);Executed by:
| 240 | ||||||||||||||||||||||||||||||
| 100 | } executed 808 times by 2 tests: end of blockExecuted by:
| 808 | ||||||||||||||||||||||||||||||
| 101 | transitionsListNeedsRefresh = false; | - | ||||||||||||||||||||||||||||||
| 102 | } executed 505 times by 2 tests: end of blockExecuted by:
| 505 | ||||||||||||||||||||||||||||||
| 103 | return executed 8347 times by 2 tests: transitionsList;return transitionsList;Executed by:
executed 8347 times by 2 tests: return transitionsList;Executed by:
| 8347 | ||||||||||||||||||||||||||||||
| 104 | } | - | ||||||||||||||||||||||||||||||
| 105 | void QState::assignProperty(QObject *object, const char *name, | - | ||||||||||||||||||||||||||||||
| 106 | const QVariant &value) | - | ||||||||||||||||||||||||||||||
| 107 | { | - | ||||||||||||||||||||||||||||||
| 108 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 109 | if (!object
| 1-103 | ||||||||||||||||||||||||||||||
| 110 | QMessageLogger(__FILE__, 263, __PRETTY_FUNCTION__).warning("QState::assignProperty: cannot assign property '%s' of null object", name); | - | ||||||||||||||||||||||||||||||
| 111 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||||||||
| 113 | for (int i = 0; i < d->propertyAssignments.size()
| 15-101 | ||||||||||||||||||||||||||||||
| 114 | QPropertyAssignment &assn = d->propertyAssignments[i]; | - | ||||||||||||||||||||||||||||||
| 115 | if (assn.hasTarget(object, name)
| 2-13 | ||||||||||||||||||||||||||||||
| 116 | assn.value = value; | - | ||||||||||||||||||||||||||||||
| 117 | return; executed 2 times by 2 tests: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 118 | } | - | ||||||||||||||||||||||||||||||
| 119 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||||||||
| 120 | d->propertyAssignments.append(QPropertyAssignment(object, name, value)); | - | ||||||||||||||||||||||||||||||
| 121 | } executed 101 times by 2 tests: end of blockExecuted by:
| 101 | ||||||||||||||||||||||||||||||
| 122 | QAbstractState *QState::errorState() const | - | ||||||||||||||||||||||||||||||
| 123 | { | - | ||||||||||||||||||||||||||||||
| 124 | const QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 125 | return executed 44 times by 1 test: d->errorState;return d->errorState;Executed by:
executed 44 times by 1 test: return d->errorState;Executed by:
| 44 | ||||||||||||||||||||||||||||||
| 126 | } | - | ||||||||||||||||||||||||||||||
| 127 | void QState::setErrorState(QAbstractState *state) | - | ||||||||||||||||||||||||||||||
| 128 | { | - | ||||||||||||||||||||||||||||||
| 129 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 130 | if (state != 0
| 1-14 | ||||||||||||||||||||||||||||||
| 131 | QMessageLogger(__FILE__, 300, __PRETTY_FUNCTION__).warning("QStateMachine::setErrorState: root state cannot be error state"); | - | ||||||||||||||||||||||||||||||
| 132 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 133 | } | - | ||||||||||||||||||||||||||||||
| 134 | if (state != 0
| 1-13 | ||||||||||||||||||||||||||||||
| 135 | QMessageLogger(__FILE__, 304, __PRETTY_FUNCTION__).warning("QState::setErrorState: error state cannot belong " | - | ||||||||||||||||||||||||||||||
| 136 | "to a different state machine"); | - | ||||||||||||||||||||||||||||||
| 137 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 138 | } | - | ||||||||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||||||||
| 140 | if (d->errorState != state
| 1-11 | ||||||||||||||||||||||||||||||
| 141 | d->errorState = state; | - | ||||||||||||||||||||||||||||||
| 142 | errorStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 143 | } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||||||||||||||||||||
| 144 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||||||||
| 148 | - | |||||||||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||||||||
| 150 | void QState::addTransition(QAbstractTransition *transition) | - | ||||||||||||||||||||||||||||||
| 151 | { | - | ||||||||||||||||||||||||||||||
| 152 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 153 | if (!transition
| 1-233 | ||||||||||||||||||||||||||||||
| 154 | QMessageLogger(__FILE__, 323, __PRETTY_FUNCTION__).warning("QState::addTransition: cannot add null transition"); | - | ||||||||||||||||||||||||||||||
| 155 | return executed 1 time by 1 test: ;return ;Executed by:
executed 1 time by 1 test: return ;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 156 | } | - | ||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||
| 158 | transition->setParent(this); | - | ||||||||||||||||||||||||||||||
| 159 | const QVector<QPointer<QAbstractState> > &targets = QAbstractTransitionPrivate::get(transition)->targetStates; | - | ||||||||||||||||||||||||||||||
| 160 | for (int i = 0; i < targets.size()
| 224-233 | ||||||||||||||||||||||||||||||
| 161 | QAbstractState *t = targets.at(i).data(); | - | ||||||||||||||||||||||||||||||
| 162 | if (!t
| 0-224 | ||||||||||||||||||||||||||||||
| 163 | QMessageLogger(__FILE__, 332, __PRETTY_FUNCTION__).warning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||||||||
| 164 | return never executed: ;return ;never executed: return ; | 0 | ||||||||||||||||||||||||||||||
| 165 | } | - | ||||||||||||||||||||||||||||||
| 166 | if ((
| 4-220 | ||||||||||||||||||||||||||||||
| 167 | && QAbstractStatePrivate::get(t)->machine()
| 0-3 | ||||||||||||||||||||||||||||||
| 168 | QMessageLogger(__FILE__, 337, __PRETTY_FUNCTION__).warning("QState::addTransition: cannot add transition " | - | ||||||||||||||||||||||||||||||
| 169 | "to a state in a different state machine"); | - | ||||||||||||||||||||||||||||||
| 170 | return never executed: ;return ;never executed: return ; | 0 | ||||||||||||||||||||||||||||||
| 171 | } | - | ||||||||||||||||||||||||||||||
| 172 | } executed 224 times by 2 tests: end of blockExecuted by:
| 224 | ||||||||||||||||||||||||||||||
| 173 | if (QStateMachine *mach = machine()
| 9-224 | ||||||||||||||||||||||||||||||
| 174 | QStateMachinePrivate::get(mach)->maybeRegisterTransition(transition); executed 224 times by 2 tests: QStateMachinePrivate::get(mach)->maybeRegisterTransition(transition);Executed by:
| 224 | ||||||||||||||||||||||||||||||
| 175 | } executed 233 times by 2 tests: end of blockExecuted by:
| 233 | ||||||||||||||||||||||||||||||
| 176 | QSignalTransition *QState::addTransition(const QObject *sender, const char *signal, | - | ||||||||||||||||||||||||||||||
| 177 | QAbstractState *target) | - | ||||||||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||||||||
| 179 | if (!sender
| 1-64 | ||||||||||||||||||||||||||||||
| 180 | QMessageLogger(__FILE__, 366, __PRETTY_FUNCTION__).warning("QState::addTransition: sender cannot be null"); | - | ||||||||||||||||||||||||||||||
| 181 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 182 | } | - | ||||||||||||||||||||||||||||||
| 183 | if (!signal
| 1-63 | ||||||||||||||||||||||||||||||
| 184 | QMessageLogger(__FILE__, 370, __PRETTY_FUNCTION__).warning("QState::addTransition: signal cannot be null"); | - | ||||||||||||||||||||||||||||||
| 185 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 186 | } | - | ||||||||||||||||||||||||||||||
| 187 | if (!target
| 1-62 | ||||||||||||||||||||||||||||||
| 188 | QMessageLogger(__FILE__, 374, __PRETTY_FUNCTION__).warning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||||||||
| 189 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 190 | } | - | ||||||||||||||||||||||||||||||
| 191 | int offset = (*
| 2-60 | ||||||||||||||||||||||||||||||
| 192 | const QMetaObject *meta = sender->metaObject(); | - | ||||||||||||||||||||||||||||||
| 193 | if (meta->indexOfSignal(signal+offset) == -1
| 1-61 | ||||||||||||||||||||||||||||||
| 194 | if (meta->indexOfSignal(QMetaObject::normalizedSignature(signal+offset)) == -1
| 0-1 | ||||||||||||||||||||||||||||||
| 195 | QMessageLogger(__FILE__, 381, __PRETTY_FUNCTION__).warning("QState::addTransition: no such signal %s::%s", | - | ||||||||||||||||||||||||||||||
| 196 | meta->className(), signal+offset); | - | ||||||||||||||||||||||||||||||
| 197 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 198 | } | - | ||||||||||||||||||||||||||||||
| 199 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 200 | QSignalTransition *trans = new QSignalTransition(sender, signal); | - | ||||||||||||||||||||||||||||||
| 201 | trans->setTargetState(target); | - | ||||||||||||||||||||||||||||||
| 202 | addTransition(trans); | - | ||||||||||||||||||||||||||||||
| 203 | return executed 61 times by 2 tests: trans;return trans;Executed by:
executed 61 times by 2 tests: return trans;Executed by:
| 61 | ||||||||||||||||||||||||||||||
| 204 | } | - | ||||||||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||||||||
| 206 | namespace { | - | ||||||||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||||||||
| 208 | - | |||||||||||||||||||||||||||||||
| 209 | class UnconditionalTransition : public QAbstractTransition | - | ||||||||||||||||||||||||||||||
| 210 | { | - | ||||||||||||||||||||||||||||||
| 211 | public: | - | ||||||||||||||||||||||||||||||
| 212 | UnconditionalTransition(QAbstractState *target) | - | ||||||||||||||||||||||||||||||
| 213 | : QAbstractTransition() | - | ||||||||||||||||||||||||||||||
| 214 | { setTargetState(target); } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||||||||
| 215 | protected: | - | ||||||||||||||||||||||||||||||
| 216 | void onTransition(QEvent *) override {} | - | ||||||||||||||||||||||||||||||
| 217 | bool eventTest(QEvent *) override { return executed 19 times by 1 test: true;return true;Executed by:
executed 19 times by 1 test: }return true;Executed by:
| 19 | ||||||||||||||||||||||||||||||
| 218 | }; | - | ||||||||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||||||||
| 220 | } | - | ||||||||||||||||||||||||||||||
| 221 | - | |||||||||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||||||||
| 226 | QAbstractTransition *QState::addTransition(QAbstractState *target) | - | ||||||||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||||||||
| 228 | if (!target
| 1-16 | ||||||||||||||||||||||||||||||
| 229 | QMessageLogger(__FILE__, 415, __PRETTY_FUNCTION__).warning("QState::addTransition: cannot add transition to null state"); | - | ||||||||||||||||||||||||||||||
| 230 | return executed 1 time by 1 test: 0;return 0;Executed by:
executed 1 time by 1 test: return 0;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 231 | } | - | ||||||||||||||||||||||||||||||
| 232 | UnconditionalTransition *trans = new UnconditionalTransition(target); | - | ||||||||||||||||||||||||||||||
| 233 | addTransition(trans); | - | ||||||||||||||||||||||||||||||
| 234 | return executed 16 times by 1 test: trans;return trans;Executed by:
executed 16 times by 1 test: return trans;Executed by:
| 16 | ||||||||||||||||||||||||||||||
| 235 | } | - | ||||||||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||
| 243 | void QState::removeTransition(QAbstractTransition *transition) | - | ||||||||||||||||||||||||||||||
| 244 | { | - | ||||||||||||||||||||||||||||||
| 245 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 246 | if (!transition
| 1-8 | ||||||||||||||||||||||||||||||
| 247 | QMessageLogger(__FILE__, 433, __PRETTY_FUNCTION__).warning("QState::removeTransition: cannot remove null transition"); | - | ||||||||||||||||||||||||||||||
| 248 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||||||||
| 250 | if (transition->sourceState() != this
| 1-7 | ||||||||||||||||||||||||||||||
| 251 | QMessageLogger(__FILE__, 437, __PRETTY_FUNCTION__).warning("QState::removeTransition: transition %p's source state (%p)" | - | ||||||||||||||||||||||||||||||
| 252 | " is different from this state (%p)", | - | ||||||||||||||||||||||||||||||
| 253 | transition, transition->sourceState(), this); | - | ||||||||||||||||||||||||||||||
| 254 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 255 | } | - | ||||||||||||||||||||||||||||||
| 256 | QStateMachinePrivate *mach = QStateMachinePrivate::get(d->machine()); | - | ||||||||||||||||||||||||||||||
| 257 | if (mach
| 2-5 | ||||||||||||||||||||||||||||||
| 258 | mach->unregisterTransition(transition); executed 5 times by 1 test: mach->unregisterTransition(transition);Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 259 | transition->setParent(0); | - | ||||||||||||||||||||||||||||||
| 260 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 261 | QList<QAbstractTransition*> QState::transitions() const | - | ||||||||||||||||||||||||||||||
| 262 | { | - | ||||||||||||||||||||||||||||||
| 263 | const QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 264 | return executed 14 times by 1 test: d->transitions();return d->transitions();Executed by:
executed 14 times by 1 test: return d->transitions();Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 265 | } | - | ||||||||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||||||||
| 270 | void QState::onEntry(QEvent *event) | - | ||||||||||||||||||||||||||||||
| 271 | { | - | ||||||||||||||||||||||||||||||
| 272 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 273 | } executed 412 times by 2 tests: end of blockExecuted by:
| 412 | ||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||||||||
| 278 | void QState::onExit(QEvent *event) | - | ||||||||||||||||||||||||||||||
| 279 | { | - | ||||||||||||||||||||||||||||||
| 280 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 281 | } executed 277 times by 2 tests: end of blockExecuted by:
| 277 | ||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||||||||
| 284 | - | |||||||||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||||||||
| 286 | QAbstractState *QState::initialState() const | - | ||||||||||||||||||||||||||||||
| 287 | { | - | ||||||||||||||||||||||||||||||
| 288 | const QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 289 | return executed 382 times by 2 tests: d->initialState;return d->initialState;Executed by:
executed 382 times by 2 tests: return d->initialState;Executed by:
| 382 | ||||||||||||||||||||||||||||||
| 290 | } | - | ||||||||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||||||||
| 296 | void QState::setInitialState(QAbstractState *state) | - | ||||||||||||||||||||||||||||||
| 297 | { | - | ||||||||||||||||||||||||||||||
| 298 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 299 | if (d->childMode == QState::ParallelStates
| 2-181 | ||||||||||||||||||||||||||||||
| 300 | QMessageLogger(__FILE__, 496, __PRETTY_FUNCTION__).warning("QState::setInitialState: ignoring attempt to set initial state " | - | ||||||||||||||||||||||||||||||
| 301 | "of parallel state group %p", this); | - | ||||||||||||||||||||||||||||||
| 302 | return; executed 2 times by 2 tests: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 303 | } | - | ||||||||||||||||||||||||||||||
| 304 | if (state
| 0-181 | ||||||||||||||||||||||||||||||
| 305 | QMessageLogger(__FILE__, 501, __PRETTY_FUNCTION__).warning("QState::setInitialState: state %p is not a child of this state (%p)", | - | ||||||||||||||||||||||||||||||
| 306 | state, this); | - | ||||||||||||||||||||||||||||||
| 307 | return; executed 1 time by 1 test: return;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 308 | } | - | ||||||||||||||||||||||||||||||
| 309 | if (d->initialState != state
| 0-180 | ||||||||||||||||||||||||||||||
| 310 | d->initialState = state; | - | ||||||||||||||||||||||||||||||
| 311 | initialStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 312 | } executed 180 times by 2 tests: end of blockExecuted by:
| 180 | ||||||||||||||||||||||||||||||
| 313 | } executed 180 times by 2 tests: end of blockExecuted by:
| 180 | ||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||||||||
| 318 | QState::ChildMode QState::childMode() const | - | ||||||||||||||||||||||||||||||
| 319 | { | - | ||||||||||||||||||||||||||||||
| 320 | const QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 321 | return executed 390 times by 2 tests: d->childMode;return d->childMode;Executed by:
executed 390 times by 2 tests: return d->childMode;Executed by:
| 390 | ||||||||||||||||||||||||||||||
| 322 | } | - | ||||||||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||
| 327 | void QState::setChildMode(ChildMode mode) | - | ||||||||||||||||||||||||||||||
| 328 | { | - | ||||||||||||||||||||||||||||||
| 329 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||
| 331 | if (mode == QState::ParallelStates
| 1-5 | ||||||||||||||||||||||||||||||
| 332 | QMessageLogger(__FILE__, 528, __PRETTY_FUNCTION__).warning("QState::setChildMode: setting the child-mode of state %p to " | - | ||||||||||||||||||||||||||||||
| 333 | "parallel removes the initial state", this); | - | ||||||||||||||||||||||||||||||
| 334 | d->initialState = nullptr; | - | ||||||||||||||||||||||||||||||
| 335 | initialStateChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 336 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||||||||
| 338 | if (d->childMode != mode
| 0-6 | ||||||||||||||||||||||||||||||
| 339 | d->childMode = mode; | - | ||||||||||||||||||||||||||||||
| 340 | childModeChanged(QState::QPrivateSignal()); | - | ||||||||||||||||||||||||||||||
| 341 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||
| 342 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||||||||
| 347 | bool QState::event(QEvent *e) | - | ||||||||||||||||||||||||||||||
| 348 | { | - | ||||||||||||||||||||||||||||||
| 349 | QStatePrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 350 | if ((
| 75-787 | ||||||||||||||||||||||||||||||
| 351 | d->childStatesListNeedsRefresh = true; | - | ||||||||||||||||||||||||||||||
| 352 | d->transitionsListNeedsRefresh = true; | - | ||||||||||||||||||||||||||||||
| 353 | if ((
| 18-787 | ||||||||||||||||||||||||||||||
| 354 | d->initialState = 0; executed 18 times by 1 test: d->initialState = 0;Executed by:
| 18 | ||||||||||||||||||||||||||||||
| 355 | } executed 862 times by 2 tests: end of blockExecuted by:
| 862 | ||||||||||||||||||||||||||||||
| 356 | return executed 1156 times by 2 tests: QAbstractState::event(e);return QAbstractState::event(e);Executed by:
executed 1156 times by 2 tests: return QAbstractState::event(e);Executed by:
| 1156 | ||||||||||||||||||||||||||||||
| 357 | } | - | ||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |