qhistorystate.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/statemachine/qhistorystate.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QHistoryStatePrivate::QHistoryStatePrivate()-
7 : QAbstractStatePrivate(HistoryState)-
8 , defaultTransition(0)-
9 , historyType(QHistoryState::ShallowHistory)-
10{-
11}
executed 9 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
9
12-
13DefaultStateTransition::DefaultStateTransition(QHistoryState *source, QAbstractState *target)-
14 : QAbstractTransition()-
15{-
16 setParent(source);-
17 setTargetState(target);-
18}
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
7
19-
20-
21-
22-
23QHistoryState::QHistoryState(QState *parent)-
24 : QAbstractState(*new QHistoryStatePrivate, parent)-
25{-
26}
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
7
27-
28-
29-
30-
31QHistoryState::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 block
Executed by:
  • tst_QStateMachine
2
37-
38-
39-
40-
41QHistoryState::~QHistoryState()-
42{-
43}-
44QAbstractTransition *QHistoryState::defaultTransition() const-
45{-
46 const QHistoryStatePrivate * const d = d_func();-
47 return
executed 4 times by 1 test: return d->defaultTransition;
Executed by:
  • tst_QStateMachine
d->defaultTransition;
executed 4 times by 1 test: return d->defaultTransition;
Executed by:
  • tst_QStateMachine
4
48}-
49void QHistoryState::setDefaultTransition(QAbstractTransition *transition)-
50{-
51 QHistoryStatePrivate * const d = d_func();-
52 if (d->defaultTransition != transition
d->defaultTran... != transitionDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QStateMachine
FALSEnever evaluated
) {
0-1
53 d->defaultTransition = transition;-
54 transition->setParent(this);-
55 defaultTransitionChanged(QHistoryState::QPrivateSignal());-
56 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QStateMachine
1
57}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QStateMachine
1
58-
59-
60-
61-
62-
63QAbstractState *QHistoryState::defaultState() const-
64{-
65 const QHistoryStatePrivate * const d = d_func();-
66 return
executed 4 times by 1 test: return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;
Executed by:
  • tst_QStateMachine
d->defaultTransition ? d->defaultTransition->targetState() : nullptr;
executed 4 times by 1 test: return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;
Executed by:
  • tst_QStateMachine
4
67}-
68-
69static inline bool isSoleEntry(const QList<QAbstractState*> &states, const QAbstractState * state)-
70{-
71 return
never executed: return states.size() == 1 && states.first() == state;
states.size() == 1 && states.first() == state;
never executed: return states.size() == 1 && states.first() == state;
0
72}-
73void QHistoryState::setDefaultState(QAbstractState *state)-
74{-
75 QHistoryStatePrivate * const d = d_func();-
76 if (state
stateDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEnever evaluated
&& state->parentState() != parentState()
state->parentS... parentState()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QStateMachine
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
) {
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:
  • tst_QStateMachine
2
80 }-
81 if (!d->defaultTransition
!d->defaultTransitionDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEnever evaluated
|| !isSoleEntry(d->defaultTransition->targetStates(), state)
!isSoleEntry(d...ates(), state)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-7
82 if (!d->defaultTransition
!d->defaultTransitionDescription
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QState
  • tst_QStateMachine
FALSEnever evaluated
|| !qobject_cast<DefaultStateTransition*>(d->defaultTransition)
!qobject_cast<...ultTransition)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-7
83 d->defaultTransition = new DefaultStateTransition(this, state);-
84 defaultTransitionChanged(QHistoryState::QPrivateSignal());-
85 }
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
else {
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 block
Executed by:
  • tst_QState
  • tst_QStateMachine
7
90}
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QState
  • tst_QStateMachine
7
91-
92-
93-
94-
95QHistoryState::HistoryType QHistoryState::historyType() const-
96{-
97 const QHistoryStatePrivate * const d = d_func();-
98 return
executed 5 times by 1 test: return d->historyType;
Executed by:
  • tst_QStateMachine
d->historyType;
executed 5 times by 1 test: return d->historyType;
Executed by:
  • tst_QStateMachine
5
99}-
100-
101-
102-
103-
104void QHistoryState::setHistoryType(HistoryType type)-
105{-
106 QHistoryStatePrivate * const d = d_func();-
107 if (d->historyType != type
d->historyType != typeDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QStateMachine
FALSEnever evaluated
) {
0-3
108 d->historyType = type;-
109 historyTypeChanged(QHistoryState::QPrivateSignal());-
110 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
3
111}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QStateMachine
3
112-
113-
114-
115-
116void QHistoryState::onEntry(QEvent *event)-
117{-
118 (void)event;;-
119}
never executed: end of block
0
120-
121-
122-
123-
124void QHistoryState::onExit(QEvent *event)-
125{-
126 (void)event;;-
127}
never executed: end of block
0
128-
129-
130-
131-
132bool QHistoryState::event(QEvent *e)-
133{-
134 return
executed 9 times by 2 tests: return QAbstractState::event(e);
Executed by:
  • tst_QState
  • tst_QStateMachine
QAbstractState::event(e);
executed 9 times by 2 tests: return QAbstractState::event(e);
Executed by:
  • tst_QState
  • tst_QStateMachine
9
135}-
136-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9