34 #include <QAbstractTransition>
48 connect(
this, SIGNAL(started()),
this, SLOT(startedSlot()));
49 mActionGroup =
new QActionGroup(
this);
53 connect(
mServices->patient().get(), SIGNAL(clinicalApplicationChanged()),
this, SLOT(clinicalApplicationChangedSlot()));
60 void WorkflowStateMachine::clinicalApplicationChangedSlot()
65 void WorkflowStateMachine::startedSlot()
73 transToState->setTargetState(state);
78 mStates[state->
getUid()] = state;
90 QList<QAction *> actions = mActionGroup->actions();
91 for (
int i = 1; i <= actions.size(); ++i)
93 QString shortcut =
"Ctrl+" + QString::number(i);
94 actions[i - 1]->setShortcut(shortcut);
100 void WorkflowStateMachine::fillActionGroup(
WorkflowState* current, QActionGroup* group)
102 std::vector<WorkflowState*> childStates = current->
getChildStates();
104 if (childStates.empty())
110 for (
unsigned i = 0; i < childStates.size(); ++i)
111 this->fillActionGroup(childStates[i], group);
124 QSet<QAbstractState *> states = this->configuration();
125 for (QSet<QAbstractState *>::iterator iter = states.begin(); iter != states.end(); ++iter)
void activeStateChanged()
WorkflowState * mParentState
void setActiveState(QString uid)
virtual QString getUid() const
Utility class for StateService states.
virtual WorkflowState * newState(WorkflowState *state)
std::vector< WorkflowState * > getChildStates()
QActionGroup * getActionGroup()
QString getActiveUidState()
WorkflowStateMachine(CoreServicesPtr services)
virtual ~WorkflowStateMachine()
void activeStateAboutToChange()
QAction * createAction(QActionGroup *group)
CoreServicesPtr mServices
State in a WorkflowStateMachine.
boost::shared_ptr< class CoreServices > CoreServicesPtr
Utility class for StateService states.