KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
modifytransitioncommand_p.h
Go to the documentation of this file.
1/*
2 This file is part of the KDAB State Machine Editor Library.
3
4 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: Kevin Funk <kevin.funk@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9 Licensees holding valid commercial KDAB State Machine Editor Library
10 licenses may use this file in accordance with the KDAB State Machine Editor
11 Library License Agreement provided with the Software.
12
13 Contact info@kdab.com if any conditions of this licensing are not clear to you.
14*/
15
16#ifndef KDSME_COMMAND_MODIFYTRANSITIONCOMMAND_P_H
17#define KDSME_COMMAND_MODIFYTRANSITIONCOMMAND_P_H
18
19#include "command_p.h"
20
21#include <QPainterPath>
22#include <QPointer>
23
24namespace KDSME {
25
26class State;
27class Transition;
28
35class KDSME_VIEW_EXPORT ModifyTransitionCommand : public Command
36{
37 Q_OBJECT
38
39public:
40 explicit ModifyTransitionCommand(Transition *transition, StateModel *model, QUndoCommand *parent = nullptr);
41
42 int id() const override
43 {
44 return ModifyTransition;
45 }
46
47 Q_INVOKABLE void setSourceState(KDSME::State *sourceState);
48 Q_INVOKABLE void setTargetState(KDSME::State *targetState);
49 Q_INVOKABLE void setShape(const QPainterPath &shape);
50
51 void redo() override;
52 void undo() override;
53 bool mergeWith(const QUndoCommand *other) override;
54
55private:
56 void updateText();
57
58 QPointer<Transition> m_transition;
59
60 enum Operation
61 {
62 NoOperation,
63 SetSourceStateOperation,
64 SetTargetStateOperation,
65 SetShapeOperation
66 } m_operation;
67
68 QPointer<State> m_sourceState, m_oldSourceState;
69 QPointer<State> m_targetState, m_oldTargetState;
70 QPainterPath m_shape, m_oldShape;
71};
72
73}
74
75#endif // MODIFYTRANSITIONCOMMAND_P_H
Command for modifying properties of a KDSME::Transition.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8