OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyGridItem.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTGui/Property.h"
11#include "OTGui/PropertyBase.h"
15
16// Qt header
17#include <QtCore/qobject.h>
18
19// std header
20#include <string>
21
22class QWidget;
23
24namespace ot {
25
26 class Label;
27 class Property;
28 class PropertyInput;
29 class PropertyGridGroup;
30
31 class OT_WIDGETS_API_EXPORT PropertyGridItem : public QObject, public TreeWidgetItem {
32 Q_OBJECT
34 public:
36 virtual ~PropertyGridItem();
37
40 virtual bool setupFromConfig(const Property* _config);
41
43 void finishSetup(void);
44
45 void setParentPropertyGroup(PropertyGridGroup* _group) { m_parentGroup = _group; };
46 PropertyGridGroup* getParentPropertyGroup(void) const { return m_parentGroup; };
47
50 std::string getGroupName(void) const;
51
52 void setTitle(const QString& _title);
53 QString getTitle(void) const;
54
55 void setInput(PropertyInput* _input);
56 PropertyInput* getInput(void) const { return m_input; };
57
58 PropertyBase getPropertyData(void) const;
59 std::string getPropertyType(void) const;
60
61 Q_SIGNALS:
62 void inputValueChanged(const ot::Property* const _property);
63 void deleteRequested(const ot::Property* const _property);
64
65 private Q_SLOTS:
66 void slotValueChanged(void);
67 void slotDeleteRequested(void);
68 void slotGlobalStyleChanged(const ColorStyle& _style);
69
70 private:
71 void clear(void);
72 Property* createSignalProperty(void);
73
74 PropertyGridGroup* m_parentGroup;
75
76 QWidget* m_titleLayoutW;
77 Label* m_deleteLabel;
78 Label* m_titleLabel;
79
80 PropertyInput* m_input;
81 };
82
83}
84
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Q_DECLARE_METATYPE(const char *)
Definition ColorStyle.h:24
Definition Label.h:17
The PropertyBase class is used to hold general Property information.
Definition PropertyBase.h:25
Definition PropertyGridGroup.h:25
Definition PropertyGridItem.h:31
PropertyGridGroup * getParentPropertyGroup(void) const
Definition PropertyGridItem.h:46
PropertyInput * getInput(void) const
Definition PropertyGridItem.h:56
void inputValueChanged(const ot::Property *const _property)
void setParentPropertyGroup(PropertyGridGroup *_group)
Definition PropertyGridItem.h:45
void deleteRequested(const ot::Property *const _property)
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition PropertyInput.h:23
Definition TreeWidgetItem.h:17
Definition Connector.h:8