22int elementDepth(
const Element *element)
28 const Element *current = element;
38struct DepthChecker::Private
56 , d(new Private(this))
81 disconnect(d->m_target, SIGNAL(parentChanged(
Element*)),
82 this, SLOT(updateDepth()));
90 connect(d->m_target, SIGNAL(parentChanged(
Element*)),
91 this, SLOT(updateDepth()));
99void DepthChecker::Private::updateDepth()
101 const int depth = elementDepth(m_target);
102 if (m_depth == depth)
106 Q_EMIT q->depthChanged(m_depth);
109#include "moc_depthchecker.cpp"
void setTarget(Element *target)
void targetChanged(QObject *target)
DepthChecker(QObject *parent=nullptr)
Element * parentElement() const
KDSME_CORE_EXPORT int depth(const QObject *root, const QObject *object)