100 QMap<QString, StateInstanceData> stateInstanceData;
102 std::function<QMap<QString, StateInstanceData>(
StateItem*)> getChildren;
105 QMap<QString, StateInstanceData> stateInstanceData;
108 auto fullpath = substateItem->getFullStatePath();
110 data.active = substateItem->isActive();
111 data.fullStatePath = fullpath;
112 data.stateInstance = substateItem->getStateInstance();
113 stateInstanceData[fullpath] =
data;
114 auto map = getChildren(substateItem);
115 for (
auto& key : map.keys())
117 stateInstanceData[key] = map[key];
120 return stateInstanceData;
123 if (topLevelStateItem)
125 stateInstanceData = getChildren(topLevelStateItem);
126 auto fullpath = topLevelStateItem->getFullStatePath();
128 data.active = topLevelStateItem->isActive();
129 data.fullStatePath = fullpath;
130 data.stateInstance = topLevelStateItem->getStateInstance();
131 stateInstanceData[fullpath] =
data;
134 return stateInstanceData;