KDStateMachineEditor  1.0.0
A framework for creating Qt State Machine metacode using a graphical user interface
statemachineview.h
1 /*
2  statemachineview.h
3 
4  This file is part of the KDAB State Machine Editor Library.
5 
6  Copyright (C) 2014-2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com.
7  All rights reserved.
8  Author: Kevin Funk <kevin.funk@kdab.com>
9 
10  Licensees holding valid commercial KDAB State Machine Editor Library
11  licenses may use this file in accordance with the KDAB State Machine Editor
12  Library License Agreement provided with the Software.
13 
14  This file may be distributed and/or modified under the terms of the
15  GNU Lesser General Public License version 2.1 as published by the
16  Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
17 
18  This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
19  WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 
21  Contact info@kdab.com if any conditions of this licensing are not
22  clear to you.
23 */
24 
25 #ifndef KDSME_WIDGETS_STATEMACHINEVIEW_H
26 #define KDSME_WIDGETS_STATEMACHINEVIEW_H
27 
28 #include "kdsme_view_export.h"
29 
30 #include <QQuickWidget>
31 
32 namespace KDSME {
33 
34 class Command;
35 class EditController;
36 class CommandController;
37 class StateMachineScene;
38 class StateMachine;
39 class Element;
40 
48 class KDSME_VIEW_EXPORT StateMachineView : public QQuickWidget
49 {
50  Q_OBJECT
51  Q_PROPERTY(KDSME::StateMachineScene* scene READ scene WRITE setScene NOTIFY sceneChanged)
52  Q_PROPERTY(KDSME::CommandController* commandController READ commandController CONSTANT)
53  Q_PROPERTY(KDSME::EditController* editController READ editController CONSTANT)
54 
55 public:
56  explicit StateMachineView(QWidget* parent = nullptr);
57  virtual ~StateMachineView();
58 
59  StateMachineScene* scene() const;
60 
61  CommandController* commandController() const;
62  EditController* editController() const;
63 
64  Q_INVOKABLE void sendCommand(KDSME::Command* cmd);
65 
66  Q_INVOKABLE void fitInView();
67 
68  Q_INVOKABLE void changeStateMachine(KDSME::StateMachine *stateMachine);
69  Q_INVOKABLE void deleteElement(KDSME::Element *element);
70 
71 protected:
72  QQuickItem* viewPortObject() const;
73  QQuickItem* sceneObject() const;
74 
75 Q_SIGNALS:
76  void sceneChanged(KDSME::StateMachineScene* scene);
77 
78 private:
79  struct Private;
80  QScopedPointer<Private> d;
81 
82  void setScene(StateMachineScene* scene);
83 
84  Q_PRIVATE_SLOT(d, void onStateMachineChanged(KDSME::StateMachine*))
85 };
86 
87 }
88 
95 #endif // STARTCHARTVIEW_H
Definition: state.h:160
Widget for displaying a KDSME::StateMachine in a Qt Quick based view.
Definition: statemachineview.h:48
Definition: commandcontroller.h:40
Definition: statemachinescene.h:43
Definition: element.h:41
Definition: editcontroller.h:36
Definition: abstractexporter.h:33

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
https://github.com/KDAB/KDStateMachineEditor