diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 8d131cecc5b..eee9cbd793e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -197,6 +197,7 @@ QObjectPrivate::QObjectPrivate(int version) metaObject = nullptr; isWindow = false; deleteLaterCalled = false; + isQuickItem = false; } QObjectPrivate::~QObjectPrivate() @@ -1303,6 +1304,17 @@ QBindable QObject::bindableObjectName() \c{inherits("QWindow")}, except that it is much faster. */ +/*! + \fn bool QObject::isQuickItemType() const + + Returns \c true if the object is a QQuickItem; otherwise returns \c false. + + Calling this function is equivalent to calling + \c{inherits("QQuickItem")}, except that it is much faster. + + \since 6.4 +*/ + /*! This virtual function receives events to an object and should return true if the event \a e was recognized and processed. diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 8a45e73b0e9..b186845c400 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -107,7 +107,8 @@ public: uint receiveChildEvents : 1; uint isWindow : 1; // for QWindow uint deleteLaterCalled : 1; - uint unused : 24; + uint isQuickItem : 1; + uint unused : 23; int postedEvents; QDynamicMetaObjectData *metaObject; QBindingStorage bindingStorage; @@ -147,6 +148,7 @@ public: inline bool isWidgetType() const { return d_ptr->isWidget; } inline bool isWindowType() const { return d_ptr->isWindow; } + inline bool isQuickItemType() const { return d_ptr->isQuickItem; } inline bool signalsBlocked() const noexcept { return d_ptr->blockSig; } bool blockSignals(bool b) noexcept;