diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-05 19:53:01 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-10 14:16:05 +0000 |
commit | c2fd8f7d00e2a47724765e289b828c36c98da29c (patch) | |
tree | ee424a3cf41a0180996e8892339a62fc188a15da /src/quicktemplates2/qquickdialogbuttonbox_p.h | |
parent | fe7d1b895de1320499694579e6402bdc603f37d9 (diff) |
DialogButtonBox: add contentWidth and contentHeight
This is a follow-up to f1f884d3, which mentioned that:
This can be fixed properly in dev by providing separate contentWidth
and contentHeight properties that cleanly propagate the content size
to QML.
[ChangeLog][Controls][DialogButtonBox] Added contentWidth and
contentHeight properties.
Change-Id: I4b53702568c55d666bccb587af9fe8c8eba0b63d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdialogbuttonbox_p.h')
-rw-r--r-- | src/quicktemplates2/qquickdialogbuttonbox_p.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdialogbuttonbox_p.h b/src/quicktemplates2/qquickdialogbuttonbox_p.h index df302e54..0edc671d 100644 --- a/src/quicktemplates2/qquickdialogbuttonbox_p.h +++ b/src/quicktemplates2/qquickdialogbuttonbox_p.h @@ -68,6 +68,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialogButtonBox : public QQuickCont Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL) // 2.5 (Qt 5.12) Q_PROPERTY(ButtonLayout buttonLayout READ buttonLayout WRITE setButtonLayout RESET resetButtonLayout NOTIFY buttonLayoutChanged FINAL REVISION 5) + Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL REVISION 5) + Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL REVISION 5) Q_FLAGS(QPlatformDialogHelper::StandardButtons) public: @@ -114,6 +116,14 @@ public: void setButtonLayout(ButtonLayout layout); void resetButtonLayout(); + qreal contentWidth() const; + void setContentWidth(qreal width); + void resetContentWidth(); + + qreal contentHeight() const; + void setContentHeight(qreal height); + void resetContentHeight(); + Q_SIGNALS: void accepted(); void rejected(); @@ -129,6 +139,8 @@ Q_SIGNALS: Q_REVISION(3) void discarded(); // 2.5 (Qt 5.12) Q_REVISION(5) void buttonLayoutChanged(); + Q_REVISION(5) void contentWidthChanged(); + Q_REVISION(5) void contentHeightChanged(); protected: void updatePolish() override; |