diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-24 16:36:23 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-25 07:21:29 +0000 |
commit | cb80c055e7d8a242c529c9f72c9a9b8d87a90f31 (patch) | |
tree | 39ad3246eda83e0c505bcb8b807c92ee9e3130bb /src/quicktemplates2/qquickpage_p.h | |
parent | 32810acaa191ba00be5aac5d771c23b87628292c (diff) |
Page: provide implicit size
Even though the control was designed to be used as full-screen page, it
can be sometimes useful to have non-fullscreen pages. In order to make
Page behave well in layouts, it must provide a suitable implicit size.
[ChangeLog][Controls][Page] Page has been made to calculate its
implicit size based on the implicit size of the header, content, and
footer plus paddings, and the implicit size of the background item.
Task-number: QTBUG-56709
Change-Id: I0f40897df6e54d7bde01a464e24f0398b12bc865
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpage_p.h')
-rw-r--r-- | src/quicktemplates2/qquickpage_p.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h index 2cb77378..c63b11d7 100644 --- a/src/quicktemplates2/qquickpage_p.h +++ b/src/quicktemplates2/qquickpage_p.h @@ -61,6 +61,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPage : public QQuickControl Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) + Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL REVISION 1) + Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL REVISION 1) Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL) Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL) Q_CLASSINFO("DefaultProperty", "contentData") @@ -77,6 +79,12 @@ public: QQuickItem *footer() const; void setFooter(QQuickItem *footer); + qreal contentWidth() const; + void setContentWidth(qreal width); + + qreal contentHeight() const; + void setContentHeight(qreal height); + QQmlListProperty<QObject> contentData(); QQmlListProperty<QQuickItem> contentChildren(); @@ -84,6 +92,8 @@ Q_SIGNALS: void titleChanged(); void headerChanged(); void footerChanged(); + Q_REVISION(1) void contentWidthChanged(); + Q_REVISION(1) void contentHeightChanged(); void contentChildrenChanged(); protected: |