KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
quicksceneitem_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_QUICK_QUICKSCENEITEM_P_H
17#define KDSME_QUICK_QUICKSCENEITEM_P_H
18
19#include <QQuickItem>
20
21#include "statemachinescene.h"
22
23#include <QPainterPath>
24
25namespace KDSME {
26class Element;
27class Transition;
28}
29
30class QuickSceneItem : public QQuickItem
31{
32 Q_OBJECT
33 Q_PROPERTY(KDSME::StateMachineScene *scene READ scene WRITE setScene NOTIFY sceneChanged FINAL)
34 Q_PROPERTY(KDSME::Element *element READ element WRITE setElement NOTIFY elementChanged FINAL)
35 Q_PROPERTY(QPainterPath shape READ shape WRITE setShape NOTIFY shapeChanged FINAL)
36 Q_PROPERTY(qreal activeness READ activeness WRITE setActiveness NOTIFY activenessChanged FINAL)
37
38public:
39 explicit QuickSceneItem(QQuickItem *parent = nullptr);
41
42 KDSME::StateMachineScene *scene() const;
43
44 KDSME::Element *element() const;
45
46 QPainterPath shape() const;
47 void setShape(const QPainterPath &shape);
48
49 qreal activeness() const;
50 void setActiveness(qreal activeness);
51
52Q_SIGNALS:
53 void sceneChanged(KDSME::StateMachineScene *scene);
54 void elementChanged(KDSME::Element *element);
55 void shapeChanged(const QPainterPath &shape);
57 void clicked();
58
59protected:
60 virtual void setScene(KDSME::StateMachineScene *scene);
61 virtual void setElement(KDSME::Element *element);
62
63 bool contains(const QPointF &point) const override;
64
65 void mousePressEvent(QMouseEvent *event) override;
66 void mouseReleaseEvent(QMouseEvent *event) override;
67
68 QQuickItem *itemForElement(KDSME::Element *element) const;
69
70 Q_INVOKABLE void sendClickEvent();
71
72private:
73 KDSME::StateMachineScene *m_scene;
74 KDSME::Element *m_element;
75 QPainterPath m_shape;
76 qreal m_activeness;
77};
78
80{
81 Q_OBJECT
82
83public:
84 explicit QuickStateItem(QQuickItem *parent = nullptr);
85};
86
88{
89 Q_OBJECT
90
91public:
92 explicit QuickTransitionItem(QQuickItem *parent = nullptr);
93
94 void setElement(KDSME::Element *element) override;
95
96private Q_SLOTS:
97 void updatePosition();
98 void updateSource();
99 void updateTarget();
100
101private:
102 KDSME::Transition *toTransition() const;
103
104 QMetaObject::Connection m_sourceStateConnection;
105 QMetaObject::Connection m_targetStateConnection;
106};
107
108#endif // KDSME_QUICK_QUICKSCENEITEM_P_H
bool contains(const QPointF &point) const override
void setShape(const QPainterPath &shape)
virtual void setScene(KDSME::StateMachineScene *scene)
QPainterPath shape
KDSME::StateMachineScene * scene
void activenessChanged(qreal activeness)
QQuickItem * itemForElement(KDSME::Element *element) const
void setActiveness(qreal activeness)
void shapeChanged(const QPainterPath &shape)
void elementChanged(KDSME::Element *element)
void mouseReleaseEvent(QMouseEvent *event) override
void mousePressEvent(QMouseEvent *event) override
Q_INVOKABLE void sendClickEvent()
void sceneChanged(KDSME::StateMachineScene *scene)
virtual void setElement(KDSME::Element *element)
KDSME::Element * element

© 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