MCPcopy Create free account
hub / github.com/KDAB/GammaRay / indexForState

Method indexForState

plugins/statemachineviewer/statemodel.cpp:83–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83QModelIndex StateModelPrivate::indexForState(State state) const
84{
85 if (!m_stateMachine)
86 return {};
87
88 if (state == m_stateMachine->rootState())
89 return QModelIndex();
90
91 Q_Q(const StateModel);
92 State parentState = m_stateMachine->parentState(state);
93 int row = m_stateMachine->stateChildren(parentState).indexOf(state);
94 if (row == -1)
95 return QModelIndex();
96 return q->index(row, 0, indexForState(parentState));
97}
98
99void StateModelPrivate::stateConfigurationChanged()
100{

Callers

nothing calls this directly

Calls 5

QModelIndexClass · 0.70
rootStateMethod · 0.45
parentStateMethod · 0.45
stateChildrenMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected