KDStateMachineEditor API Documentation
2.1
Loading...
Searching...
No Matches
src
view
commandcontroller.cpp
Go to the documentation of this file.
1
/*
2
This file is part of the KDAB State Machine Editor Library.
3
4
SPDX-FileCopyrightText: 2014 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
#include "
commandcontroller.h
"
17
18
#include "
command_p.h
"
19
#include "
element.h
"
20
21
#include <QQmlEngine>
22
23
using namespace
KDSME
;
24
25
struct
CommandController::Private
26
{
27
Private();
28
29
QUndoStack *m_undoStack;
30
};
31
32
CommandController::Private::Private()
33
: m_undoStack(nullptr)
34
{
35
}
36
37
CommandController::CommandController
(QUndoStack *undoStack,
StateMachineView
*parent)
38
:
AbstractController
(parent)
39
, d(new Private)
40
{
41
d->m_undoStack =
undoStack
;
42
Q_ASSERT(d->m_undoStack);
43
44
qRegisterMetaType<Command *>();
45
}
46
47
CommandController::~CommandController
()
48
{
49
}
50
51
QUndoStack *
CommandController::undoStack
()
const
52
{
53
return
d->m_undoStack;
54
}
55
56
void
CommandController::push
(
KDSME::Command
*command)
57
{
58
Q_ASSERT(command);
59
QQmlEngine::setObjectOwnership(command, QQmlEngine::CppOwnership);
// transfer ownership
60
d->m_undoStack->push(command);
61
}
62
63
void
CommandController::clear
()
64
{
65
d->m_undoStack->clear();
66
}
67
68
#include "moc_commandcontroller.cpp"
KDSME::AbstractController
Definition
abstractcontroller.h:28
KDSME::CommandController::push
Q_INVOKABLE void push(KDSME::Command *command)
Definition
commandcontroller.cpp:56
KDSME::CommandController::undoStack
QUndoStack * undoStack
Definition
commandcontroller.h:36
KDSME::CommandController::CommandController
CommandController(QUndoStack *undoStack, StateMachineView *parent)
Definition
commandcontroller.cpp:37
KDSME::CommandController::clear
void clear()
Definition
commandcontroller.cpp:63
KDSME::CommandController::~CommandController
~CommandController()
Definition
commandcontroller.cpp:47
KDSME::Command
Definition
command_p.h:27
KDSME::StateMachineView
Widget for displaying a KDSME::StateMachine in a Qt Quick based view.
Definition
statemachineview.h:40
command_p.h
commandcontroller.h
element.h
KDSME
Definition
mainwindow.h:21
© 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