diff options
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r-- | src/quick/items/qquickitem_p.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 2faf694eeb..841d91bb40 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -152,6 +152,7 @@ class QQuickItemLayer : public QObject, public QQuickItemChangeListener Q_PROPERTY(QQmlComponent *effect READ effect WRITE setEffect NOTIFY effectChanged) Q_PROPERTY(QQuickShaderEffectSource::TextureMirroring textureMirroring READ textureMirroring WRITE setTextureMirroring NOTIFY textureMirroringChanged) Q_PROPERTY(int samples READ samples WRITE setSamples NOTIFY samplesChanged) + QML_ANONYMOUS public: QQuickItemLayer(QQuickItem *item); @@ -335,7 +336,7 @@ public: struct ChangeListener { using ChangeTypes = QQuickItemPrivate::ChangeTypes; - ChangeListener(QQuickItemChangeListener *l = nullptr, ChangeTypes t = nullptr) + ChangeListener(QQuickItemChangeListener *l = nullptr, ChangeTypes t = { }) : listener(l) , types(t) , gTypes(QQuickGeometryChange::All) @@ -470,6 +471,7 @@ public: bool isTabFence:1; bool replayingPressEvent:1; bool touchEnabled:1; + bool hasCursorHandler:1; enum DirtyType { TransformOrigin = 0x00000001, @@ -650,6 +652,10 @@ public: void setHasCursorInChild(bool hasCursor); void setHasHoverInChild(bool hasHover); +#if QT_CONFIG(cursor) + QCursor effectiveCursor(const QQuickPointerHandler *handler) const; + QQuickPointerHandler *effectiveCursorHandler() const; +#endif virtual void updatePolish() { } }; @@ -715,6 +721,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickKeyNavigationAttached : public QObject, publi Q_PROPERTY(QQuickItem *backtab READ backtab WRITE setBacktab NOTIFY backtabChanged) Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) + QML_NAMED_ELEMENT(KeyNavigation) + QML_UNCREATABLE("KeyNavigation is only available via attached properties.") + QML_ATTACHED(QQuickKeyNavigationAttached) + public: QQuickKeyNavigationAttached(QObject * = nullptr); @@ -760,6 +770,10 @@ class QQuickLayoutMirroringAttached : public QObject Q_PROPERTY(bool enabled READ enabled WRITE setEnabled RESET resetEnabled NOTIFY enabledChanged) Q_PROPERTY(bool childrenInherit READ childrenInherit WRITE setChildrenInherit NOTIFY childrenInheritChanged) + QML_NAMED_ELEMENT(LayoutMirroring) + QML_UNCREATABLE("LayoutMirroring is only available via attached properties.") + QML_ATTACHED(QQuickLayoutMirroringAttached) + public: explicit QQuickLayoutMirroringAttached(QObject *parent = nullptr); @@ -784,6 +798,11 @@ class QQuickEnterKeyAttached : public QObject Q_OBJECT Q_PROPERTY(Qt::EnterKeyType type READ type WRITE setType NOTIFY typeChanged) + QML_NAMED_ELEMENT(EnterKey) + QML_UNCREATABLE("EnterKey is only available via attached properties") + QML_ADDED_IN_MINOR_VERSION(6) + QML_ATTACHED(QQuickEnterKeyAttached) + public: explicit QQuickEnterKeyAttached(QObject *parent = nullptr); @@ -829,6 +848,10 @@ class QQuickKeysAttached : public QObject, public QQuickItemKeyFilter Q_PROPERTY(QQmlListProperty<QQuickItem> forwardTo READ forwardTo) Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY priorityChanged) + QML_NAMED_ELEMENT(Keys) + QML_UNCREATABLE("Keys is only available via attached properties") + QML_ATTACHED(QQuickKeysAttached) + public: QQuickKeysAttached(QObject *parent=nullptr); ~QQuickKeysAttached() override; @@ -849,7 +872,7 @@ public: QQmlListProperty<QQuickItem> forwardTo() { Q_D(QQuickKeysAttached); - return QQmlListProperty<QQuickItem>(this, d->targets); + return QQmlListProperty<QQuickItem>(this, &(d->targets)); } void componentComplete() override; @@ -919,7 +942,7 @@ private: Qt::MouseButtons QQuickItemPrivate::acceptedMouseButtons() const { return ((extra.flag() ? Qt::LeftButton : Qt::MouseButton(0)) | - (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons(nullptr))); + (extra.isAllocated() ? extra->acceptedMouseButtons : Qt::MouseButtons{})); } QSGContext *QQuickItemPrivate::sceneGraphContext() const @@ -984,12 +1007,8 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QQuickItemLayer) #endif QML_DECLARE_TYPE(QQuickKeysAttached) -QML_DECLARE_TYPEINFO(QQuickKeysAttached, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QQuickKeyNavigationAttached) -QML_DECLARE_TYPEINFO(QQuickKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QQuickLayoutMirroringAttached) -QML_DECLARE_TYPEINFO(QQuickLayoutMirroringAttached, QML_HAS_ATTACHED_PROPERTIES) QML_DECLARE_TYPE(QQuickEnterKeyAttached) -QML_DECLARE_TYPEINFO(QQuickEnterKeyAttached, QML_HAS_ATTACHED_PROPERTIES) #endif // QQUICKITEM_P_H |