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

Method transitionAdded

plugins/statemachineviewer/statemachineviewerwidget.cpp:358–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358void StateMachineViewerWidget::transitionAdded(const TransitionId transitionId,
359 const StateId sourceId, const StateId targetId,
360 const QString &label)
361{
362 if (m_idToTransitionMap.contains(transitionId))
363 return;
364
365 IF_DEBUG(qDebug() << "transitionAdded" << transitionId << label << sourceId << targetId);
366
367 KDSME::State *source = m_idToStateMap.value(sourceId);
368 KDSME::State *target = m_idToStateMap.value(targetId);
369 if (!source || !target) {
370 qDebug() << "Null source or target for transition:" << transitionId;
371 return;
372 }
373
374 KDSME::Transition *transition = new KDSME::Transition(source);
375 transition->setTargetState(target);
376 transition->setLabel(label);
377 transition->setFlags(KDSME::Element::ElementIsSelectable);
378 m_idToTransitionMap[transitionId] = transition;
379}
380
381void StateMachineViewerWidget::statusChanged(const bool haveStateMachine, const bool running)
382{

Callers

nothing calls this directly

Calls 2

setLabelMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected