| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qhistorystate.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | QHistoryStatePrivate::QHistoryStatePrivate() | - | ||||||||||||
| 7 | : QAbstractStatePrivate(HistoryState) | - | ||||||||||||
| 8 | , defaultTransition(0) | - | ||||||||||||
| 9 | , historyType(QHistoryState::ShallowHistory) | - | ||||||||||||
| 10 | { | - | ||||||||||||
| 11 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||
| 12 | - | |||||||||||||
| 13 | DefaultStateTransition::DefaultStateTransition(QHistoryState *source, QAbstractState *target) | - | ||||||||||||
| 14 | : QAbstractTransition() | - | ||||||||||||
| 15 | { | - | ||||||||||||
| 16 | setParent(source); | - | ||||||||||||
| 17 | setTargetState(target); | - | ||||||||||||
| 18 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | QHistoryState::QHistoryState(QState *parent) | - | ||||||||||||
| 24 | : QAbstractState(*new QHistoryStatePrivate, parent) | - | ||||||||||||
| 25 | { | - | ||||||||||||
| 26 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | QHistoryState::QHistoryState(HistoryType type, QState *parent) | - | ||||||||||||
| 32 | : QAbstractState(*new QHistoryStatePrivate, parent) | - | ||||||||||||
| 33 | { | - | ||||||||||||
| 34 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 35 | d->historyType = type; | - | ||||||||||||
| 36 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||
| 37 | - | |||||||||||||
| 38 | - | |||||||||||||
| 39 | - | |||||||||||||
| 40 | - | |||||||||||||
| 41 | QHistoryState::~QHistoryState() | - | ||||||||||||
| 42 | { | - | ||||||||||||
| 43 | } | - | ||||||||||||
| 44 | QAbstractTransition *QHistoryState::defaultTransition() const | - | ||||||||||||
| 45 | { | - | ||||||||||||
| 46 | const QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 47 | return executed 4 times by 1 test: d->defaultTransition;return d->defaultTransition;Executed by:
executed 4 times by 1 test: return d->defaultTransition;Executed by:
| 4 | ||||||||||||
| 48 | } | - | ||||||||||||
| 49 | void QHistoryState::setDefaultTransition(QAbstractTransition *transition) | - | ||||||||||||
| 50 | { | - | ||||||||||||
| 51 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 52 | if (d->defaultTransition != transition
| 0-1 | ||||||||||||
| 53 | d->defaultTransition = transition; | - | ||||||||||||
| 54 | transition->setParent(this); | - | ||||||||||||
| 55 | defaultTransitionChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 56 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 57 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||
| 58 | - | |||||||||||||
| 59 | - | |||||||||||||
| 60 | - | |||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | QAbstractState *QHistoryState::defaultState() const | - | ||||||||||||
| 64 | { | - | ||||||||||||
| 65 | const QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 66 | return executed 4 times by 1 test: d->defaultTransitionreturn d->defaultTransition ? d->defaultTransition->targetState() : nullptr;Executed by:
executed 4 times by 1 test: return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;Executed by:
| 2-4 | ||||||||||||
| 67 | } | - | ||||||||||||
| 68 | void QHistoryState::setDefaultState(QAbstractState *state) | - | ||||||||||||
| 69 | { | - | ||||||||||||
| 70 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 71 | if (state
| 0-9 | ||||||||||||
| 72 | QMessageLogger(__FILE__, 217, __PRETTY_FUNCTION__).warning("QHistoryState::setDefaultState: state %p does not belong " | - | ||||||||||||
| 73 | "to this history state's group (%p)", state, parentState()); | - | ||||||||||||
| 74 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||
| 75 | } | - | ||||||||||||
| 76 | if (!d->defaultTransition
| 0-7 | ||||||||||||
| 77 | || d->defaultTransition->targetStates().size() != 1
| 0 | ||||||||||||
| 78 | || d->defaultTransition->targetStates().first() != state
| 0 | ||||||||||||
| 79 | if (!d->defaultTransition
| 0-7 | ||||||||||||
| 80 | d->defaultTransition = new DefaultStateTransition(this, state); | - | ||||||||||||
| 81 | defaultTransitionChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 82 | } executed 7 times by 2 tests: else {end of blockExecuted by:
| 7 | ||||||||||||
| 83 | d->defaultTransition->setTargetState(state); | - | ||||||||||||
| 84 | } never executed: end of block | 0 | ||||||||||||
| 85 | defaultStateChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 86 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||
| 87 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||
| 88 | - | |||||||||||||
| 89 | - | |||||||||||||
| 90 | - | |||||||||||||
| 91 | - | |||||||||||||
| 92 | QHistoryState::HistoryType QHistoryState::historyType() const | - | ||||||||||||
| 93 | { | - | ||||||||||||
| 94 | const QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 95 | return executed 5 times by 1 test: d->historyType;return d->historyType;Executed by:
executed 5 times by 1 test: return d->historyType;Executed by:
| 5 | ||||||||||||
| 96 | } | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | - | |||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 | void QHistoryState::setHistoryType(HistoryType type) | - | ||||||||||||
| 102 | { | - | ||||||||||||
| 103 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 104 | if (d->historyType != type
| 0-3 | ||||||||||||
| 105 | d->historyType = type; | - | ||||||||||||
| 106 | historyTypeChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 107 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||
| 108 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||
| 109 | - | |||||||||||||
| 110 | - | |||||||||||||
| 111 | - | |||||||||||||
| 112 | - | |||||||||||||
| 113 | void QHistoryState::onEntry(QEvent *event) | - | ||||||||||||
| 114 | { | - | ||||||||||||
| 115 | (void)event;; | - | ||||||||||||
| 116 | } never executed: end of block | 0 | ||||||||||||
| 117 | - | |||||||||||||
| 118 | - | |||||||||||||
| 119 | - | |||||||||||||
| 120 | - | |||||||||||||
| 121 | void QHistoryState::onExit(QEvent *event) | - | ||||||||||||
| 122 | { | - | ||||||||||||
| 123 | (void)event;; | - | ||||||||||||
| 124 | } never executed: end of block | 0 | ||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | bool QHistoryState::event(QEvent *e) | - | ||||||||||||
| 130 | { | - | ||||||||||||
| 131 | return executed 9 times by 2 tests: QAbstractState::event(e);return QAbstractState::event(e);Executed by:
executed 9 times by 2 tests: return QAbstractState::event(e);Executed by:
| 9 | ||||||||||||
| 132 | } | - | ||||||||||||
| 133 | - | |||||||||||||
| Switch to Source code | Preprocessed file |