From 10458b3d4dc1ed9f06eece9d61d2e699e602117d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 5 Dec 2015 12:35:08 +0100 Subject: GroupBox: add an example of a checkable groupbox Adjust the size calculation so that the example works smooth. Change-Id: Iaf25107b0cfaa3ceef0caeba120d1bd74c9bc854 Reviewed-by: Mitch Curtis --- src/templates/qquickgroupbox.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/templates') diff --git a/src/templates/qquickgroupbox.cpp b/src/templates/qquickgroupbox.cpp index 2f120879..ef9e3da8 100644 --- a/src/templates/qquickgroupbox.cpp +++ b/src/templates/qquickgroupbox.cpp @@ -62,7 +62,20 @@ QT_BEGIN_NAMESPACE \snippet qtlabscontrols-groupbox.qml 1 - \sa {Customizing GroupBox}, {Container Controls} + \section2 Checkable GroupBox + + Even though GroupBox has no built-in check box, it is straightforward + to create a checkable GroupBox by pairing it with a CheckBox. + + \image qtlabscontrols-groupbox-checkable.png + + It is a common pattern to enable or disable the groupbox's children when + its check box is toggled on/off, respectively, but the semantics of the + check box is left to the application to decide. + + \snippet qtlabscontrols-groupbox-checkable.qml 1 + + \sa CheckBox, {Customizing GroupBox}, {Container Controls} */ class QQuickGroupBoxPrivate : public QQuickFramePrivate -- cgit v1.2.3