52 if (d->m_flags ==
flags)
65 if (d->m_label ==
label)
84 return reinterpret_cast<void *
>(d->m_id);
89 d->m_id =
reinterpret_cast<quintptr
>(ptr);
113 if (d->m_width ==
width)
127 if (d->m_height ==
height)
139 point += current->
pos();
161 return d->m_selected;
178 size = QSizeF(32, 32);
187 size = QSizeF(32, 32);
207 return qobject_cast<Element *>(
parent());
223 if (
label().isEmpty()) {
226 return QStringLiteral(
"%1 [Label: %2]").arg(str).arg(
label());
243 const auto newElementParent = qobject_cast<Element *>(
object);
244 if (oldElementParent != newElementParent) {
248 QObject::setParent(
object);
251#include "moc_element.cpp"
void visibleChanged(bool visible)
void heightChanged(qreal height)
void posChanged(const QPointF &pos)
void setPos(const QPointF &pos)
QPointF absolutePos() const
void flagsChanged(KDSME::Element::Flags flags)
QList< Element * > childElements() const
void setSelected(bool selected)
bool selected
Whether this item is marked as selected.
void setLabel(const QString &label)
void setVisible(bool visible)
void * internalPointer() const
static Q_INVOKABLE KDSME::Element::Type stringToType(const char *type)
static Q_INVOKABLE const char * typeToString(KDSME::Element::Type type)
QPointF pos
The position of the element from the top-left corner.
void setParentElement(Element *parent)
void setWidth(qreal width)
void setParent(QObject *object)
void selectedChanged(bool selected)
void setInternalPointer(void *ptr)
void parentChanged(KDSME::Element *parent)
bool visible
Whether this item is visible in the scene.
quintptr internalId() const
Element(QObject *parent=nullptr)
void labelChanged(const QString &label)
void setInternalId(quintptr id)
virtual QString toDisplayString() const
QSizeF preferredSize() const
virtual QRectF boundingRect() const
void widthChanged(qreal width)
void setFlags(Flags flags)
void setHeight(qreal height)
Element * parentElement() const
static QSizeF sizeForLabel(const QString &label)
KDSME_CORE_EXPORT QString className(const QObject *object, DisplayOption option=NoStrip)
KDSME_CORE_EXPORT int stringToEnum(const QMetaObject *metaObject, const char *name, const char *key)
KDSME_CORE_EXPORT const char * enumToString(const QMetaObject *metaObject, const char *name, int value)
QList< FilterType > copy_if_type(const QList< ItemType > &list)