widgets: add ClippingWrapperRectangle

This commit is contained in:
outfoxxed 2024-11-19 02:52:49 -08:00
parent 401ee4cec6
commit 033e810871
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 63 additions and 4 deletions

View file

@ -98,6 +98,9 @@ class WrapperManager
/// When read, `child` will always return the (potentially null) selected child,
/// and not `undefined`.
Q_PROPERTY(QQuickItem* child READ child WRITE setProspectiveChild RESET unsetChild NOTIFY childChanged FINAL);
/// The wrapper managed by this manager. Defaults to the manager's parent.
/// This property may not be changed after Component.onCompleted.
Q_PROPERTY(QQuickItem* wrapper READ wrapper WRITE setWrapper NOTIFY wrapperChanged FINAL);
// clang-format on
QML_ELEMENT;
@ -112,8 +115,12 @@ public:
void setProspectiveChild(QQuickItem* child);
void unsetChild();
[[nodiscard]] QQuickItem* wrapper() const;
void setWrapper(QQuickItem* wrapper);
signals:
void childChanged();
void wrapperChanged();
QSDOC_HIDE void initializedChildChanged();
private slots:
@ -131,6 +138,7 @@ protected:
void updateGeometry();
QQuickItem* mWrapper = nullptr;
QQuickItem* mAssignedWrapper = nullptr;
QPointer<QQuickItem> mDefaultChild;
QQuickItem* mChild = nullptr;
Flags flags;