| 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->defaultTransition ? d->defaultTransition->targetState() : nullptr; return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;Executed by: 
 executed 4 times by 1 test:  return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;Executed by: 
 | 4 | ||||||||||||
| 67 | } | - | ||||||||||||
| 68 | - | |||||||||||||
| 69 | static inline bool isSoleEntry(const QList<QAbstractState*> &states, const QAbstractState * state) | - | ||||||||||||
| 70 | { | - | ||||||||||||
| 71 | return never executed: states.size() == 1 && states.first() == state; return states.size() == 1 && states.first() == state;never executed:  return states.size() == 1 && states.first() == state; | 0 | ||||||||||||
| 72 | } | - | ||||||||||||
| 73 | void QHistoryState::setDefaultState(QAbstractState *state) | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 76 | if (state 
 
 | 0-9 | ||||||||||||
| 77 | QMessageLogger(__FILE__, 228, __PRETTY_FUNCTION__).warning("QHistoryState::setDefaultState: state %p does not belong " | - | ||||||||||||
| 78 | "to this history state's group (%p)", state, parentState()); | - | ||||||||||||
| 79 | return; executed 2 times by 1 test:  return;Executed by: 
 | 2 | ||||||||||||
| 80 | } | - | ||||||||||||
| 81 | if (!d->defaultTransition 
 
 | 0-7 | ||||||||||||
| 82 | if (!d->defaultTransition 
 
 | 0-7 | ||||||||||||
| 83 | d->defaultTransition = new DefaultStateTransition(this, state); | - | ||||||||||||
| 84 | defaultTransitionChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 85 | } executed 7 times by 2 tests: else { end of blockExecuted by: 
 | 7 | ||||||||||||
| 86 | d->defaultTransition->setTargetState(state); | - | ||||||||||||
| 87 | } never executed:  end of block | 0 | ||||||||||||
| 88 | defaultStateChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 89 | } executed 7 times by 2 tests:  end of blockExecuted by: 
 | 7 | ||||||||||||
| 90 | } executed 7 times by 2 tests:  end of blockExecuted by: 
 | 7 | ||||||||||||
| 91 | - | |||||||||||||
| 92 | - | |||||||||||||
| 93 | - | |||||||||||||
| 94 | - | |||||||||||||
| 95 | QHistoryState::HistoryType QHistoryState::historyType() const | - | ||||||||||||
| 96 | { | - | ||||||||||||
| 97 | const QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 98 | 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 | ||||||||||||
| 99 | } | - | ||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | - | |||||||||||||
| 103 | - | |||||||||||||
| 104 | void QHistoryState::setHistoryType(HistoryType type) | - | ||||||||||||
| 105 | { | - | ||||||||||||
| 106 | QHistoryStatePrivate * const d = d_func(); | - | ||||||||||||
| 107 | if (d->historyType != type 
 | 0-3 | ||||||||||||
| 108 | d->historyType = type; | - | ||||||||||||
| 109 | historyTypeChanged(QHistoryState::QPrivateSignal()); | - | ||||||||||||
| 110 | } executed 3 times by 1 test:  end of blockExecuted by: 
 | 3 | ||||||||||||
| 111 | } executed 3 times by 1 test:  end of blockExecuted by: 
 | 3 | ||||||||||||
| 112 | - | |||||||||||||
| 113 | - | |||||||||||||
| 114 | - | |||||||||||||
| 115 | - | |||||||||||||
| 116 | void QHistoryState::onEntry(QEvent *event) | - | ||||||||||||
| 117 | { | - | ||||||||||||
| 118 | (void)event;; | - | ||||||||||||
| 119 | } never executed:  end of block | 0 | ||||||||||||
| 120 | - | |||||||||||||
| 121 | - | |||||||||||||
| 122 | - | |||||||||||||
| 123 | - | |||||||||||||
| 124 | void QHistoryState::onExit(QEvent *event) | - | ||||||||||||
| 125 | { | - | ||||||||||||
| 126 | (void)event;; | - | ||||||||||||
| 127 | } never executed:  end of block | 0 | ||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | - | |||||||||||||
| 131 | - | |||||||||||||
| 132 | bool QHistoryState::event(QEvent *e) | - | ||||||||||||
| 133 | { | - | ||||||||||||
| 134 | 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 | ||||||||||||
| 135 | } | - | ||||||||||||
| 136 | - | |||||||||||||
| Switch to Source code | Preprocessed file |