26 #ifndef KDSME_MODEL_ELEMENT_H
27 #define KDSME_MODEL_ELEMENT_H
29 #include "kdsme_core_export.h"
41 class KDSME_CORE_EXPORT
Element :
public QObject
45 Q_PROPERTY(
KDSME::Element* parent READ parentElement WRITE setParentElement NOTIFY parentChanged FINAL)
46 Q_PROPERTY(Type type READ type CONSTANT FINAL)
47 Q_PROPERTY(Flags flags READ flags WRITE setFlags NOTIFY flagsChanged FINAL)
48 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged FINAL)
50 Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged FINAL)
51 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL)
52 Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL)
54 Q_PROPERTY(
bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
56 Q_PROPERTY(
bool selected READ isSelected WRITE setSelected NOTIFY selectedChanged FINAL)
65 TimeoutTransitionType,
78 ElementIsDragEnabled = 0x1,
79 ElementIsSelectable = 0x2,
80 ElementIsEditable = 0x4,
82 Q_DECLARE_FLAGS(Flags, Flag)
84 explicit Element(QObject* parent =
nullptr);
87 virtual Type type() const;
90 void setFlags(Flags flags);
95 QString label() const;
96 void setLabel(const QString& label);
103 quintptr internalId() const;
104 void setInternalId(quintptr
id);
106 void setInternalPointer(
void* ptr);
107 void* internalPointer() const;
110 void setPos(const QPointF& pos);
112 qreal height() const;
113 void setHeight(qreal height);
116 void setWidth(qreal width);
118 QPointF absolutePos() const;
120 bool isVisible() const;
121 void setVisible(
bool visible);
123 bool isSelected() const;
124 void setSelected(
bool selected);
126 QSizeF preferredSize() const;
127 virtual QRectF boundingRect() const;
129 Element* parentElement() const;
130 void setParentElement(Element* parent);
131 void setParent(QObject*
object);
132 QList<Element*> childElements() const;
134 virtual QString toDisplayString() const;
136 Q_INVOKABLE static const
char* typeToString(Type type);
137 Q_INVOKABLE static Type stringToType(const
char* type);
140 void parentChanged(Element* parent);
141 void flagsChanged(Flags flags);
142 void labelChanged(const QString& label);
143 void posChanged(const QPointF& pos);
144 void heightChanged(qreal height);
145 void widthChanged(qreal width);
146 void visibleChanged(
bool visible);
147 void selectedChanged(
bool selected);
151 QScopedPointer<Private> d;
156 Q_DECLARE_METATYPE(
KDSME::Element::Type)
157 Q_DECLARE_METATYPE(
KDSME::Element*)
159 #endif // TREESTRUCTURE_H
Definition: abstractexporter.h:33