26 #ifndef KDSME_MODEL_ELEMENT_H
27 #define KDSME_MODEL_ELEMENT_H
29 #include "kdsme_core_export.h"
43 class KDSME_CORE_EXPORT
Element :
public QObject
47 Q_PROPERTY(
KDSME::Element* parent READ parentElement WRITE setParentElement NOTIFY parentChanged FINAL)
48 Q_PROPERTY(Type type READ type CONSTANT FINAL)
49 Q_PROPERTY(Flags flags READ flags WRITE setFlags NOTIFY flagsChanged FINAL)
50 Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged FINAL)
52 Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged FINAL)
53 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL)
54 Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL)
56 Q_PROPERTY(
bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
58 Q_PROPERTY(
bool selected READ isSelected WRITE setSelected NOTIFY selectedChanged FINAL)
67 TimeoutTransitionType,
80 ElementIsDragEnabled = 0x1,
81 ElementIsSelectable = 0x2,
82 ElementIsEditable = 0x4,
84 Q_DECLARE_FLAGS(Flags, Flag)
86 explicit Element(QObject* parent =
nullptr);
89 virtual Type type() const;
92 void setFlags(Flags flags);
97 QString label() const;
98 void setLabel(const QString& label);
105 quintptr internalId() const;
106 void setInternalId(quintptr
id);
108 void setInternalPointer(
void* ptr);
109 void* internalPointer() const;
112 void setPos(const QPointF& pos);
114 qreal height() const;
115 void setHeight(qreal height);
118 void setWidth(qreal width);
120 QPointF absolutePos() const;
122 bool isVisible() const;
123 void setVisible(
bool visible);
125 bool isSelected() const;
126 void setSelected(
bool selected);
128 QSizeF preferredSize() const;
129 virtual QRectF boundingRect() const;
131 Element* parentElement() const;
132 void setParentElement(Element* parent);
133 void setParent(QObject*
object);
134 QList<Element*> childElements() const;
136 virtual QString toDisplayString() const;
138 Q_INVOKABLE static const
char* typeToString(Type type);
139 Q_INVOKABLE static Type stringToType(const
char* type);
142 void parentChanged(Element* parent);
143 void flagsChanged(Flags flags);
144 void labelChanged(const QString& label);
145 void posChanged(const QPointF& pos);
146 void heightChanged(qreal height);
147 void widthChanged(qreal width);
148 void visibleChanged(
bool visible);
149 void selectedChanged(
bool selected);
153 QScopedPointer<Private> d;
158 Q_DECLARE_METATYPE(
KDSME::Element::Type)
159 Q_DECLARE_METATYPE(
KDSME::Element*)
161 #endif // TREESTRUCTURE_H
Definition: abstractexporter.h:33