KDStateMachineEditor API Documentation 2.3
Loading...
Searching...
No Matches
statemachinescene.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: 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
17#ifndef KDSME_VIEW_STATEMACHINESCENE_H
18#define KDSME_VIEW_STATEMACHINESCENE_H
19
20#include "kdsme_view_export.h"
21#include "abstractscene.h"
22
23#include <QObject>
24
25namespace KDSME {
26class Element;
27class Layouter;
29class State;
30class StateMachine;
31class StateModel;
32class Transition;
33
34class KDSME_VIEW_EXPORT StateMachineScene : public AbstractScene
35{
36 Q_OBJECT
40 Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged FINAL)
41 Q_PROPERTY(int maximumDepth READ maximumDepth WRITE setMaximumDepth NOTIFY maximumDepthChanged FINAL)
42
43public:
44 explicit StateMachineScene(QQuickItem *parent = nullptr);
46
47 StateModel *stateModel() const;
48 void setModel(QAbstractItemModel *model) override;
49
50 State *rootState() const;
52
53 Layouter *layouter() const;
56
57 qreal zoom() const;
58 void setZoom(qreal zoom);
59
60 void zoomBy(qreal scale);
61
62 int maximumDepth() const;
64
66
67 Q_INVOKABLE void collapseItem(KDSME::State *state);
68 Q_INVOKABLE void expandItem(KDSME::State *state);
69 Q_INVOKABLE bool isItemExpanded(KDSME::State *state) const;
70 Q_INVOKABLE void setItemExpanded(KDSME::State *state, bool expand);
71
72 Q_INVOKABLE bool isItemSelected(KDSME::Element *item);
73 Q_INVOKABLE void setItemSelected(KDSME::Element *item, bool selected);
74
75 KDSME::Element *currentItem() const;
76 void setCurrentItem(KDSME::Element *item);
77
78 KDSME::Element *currentState() const;
79
80public Q_SLOTS:
81 void layout();
82
83Q_SIGNALS:
87 void zoomChanged(qreal zoom);
88 void maximumDepthChanged(int depth);
89
90protected Q_SLOTS:
91 void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
92
93 void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
94 void rowsInserted(const QModelIndex &parent, int start, int end) override;
95 void layoutChanged() override;
96
97private:
98 struct Private;
99 QScopedPointer<Private> d;
100};
101
102}
103
104Q_DECLARE_METATYPE(KDSME::StateMachineScene *)
105
106#endif // VIEW_H
QAbstractItemModel * model
AbstractScene(QQuickItem *parent=nullptr)
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override
void setModel(QAbstractItemModel *model) override
Q_INVOKABLE void collapseItem(KDSME::State *state)
StateModel * stateModel() const
StateMachineScene(QQuickItem *parent=nullptr)
void zoomChanged(qreal zoom)
Q_INVOKABLE bool isItemSelected(KDSME::Element *item)
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
void maximumDepthChanged(int depth)
void currentItemChanged(KDSME::Element *currentItem)
Q_INVOKABLE void expandItem(KDSME::State *state)
void rowsInserted(const QModelIndex &parent, int start, int end) override
KDSME::Element * currentState() const
void setCurrentItem(KDSME::Element *item)
Q_INVOKABLE void setItemSelected(KDSME::Element *item, bool selected)
Q_INVOKABLE void setItemExpanded(KDSME::State *state, bool expand)
void rootStateChanged(KDSME::State *state)
void stateMachineChanged(KDSME::StateMachine *stateMachine)
void setRootState(State *rootState)
Q_INVOKABLE bool isItemExpanded(KDSME::State *state) const
void setMaximumDepth(int maximumDepth)
KDSME::LayoutProperties * layoutProperties
void setLayouter(Layouter *layouter)
Ownership is transferred.

© 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 for KDStateMachineEditor API Documentation by doxygen 1.15.0