aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-04-19 07:20:09 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-04-19 09:34:53 +0000
commit06071fd14d6cff4d3f9b3cdff92f5ddf4bf2b3bc (patch)
tree270a4f1d68b5b6ff30013ca0b47969fafbc96221 /src/imports
parent37ef78bef2a1b8f6de7b196015a0343385ba36aa (diff)
GroupBox: add implicitLabelWidth|Height
[ChangeLog][Controls][GroupBox] Added implicitLabelWidth and implicitLabelHeight properties. Change-Id: Ieae54a3b3044b306cd00f45101c6573b5291352d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/controls/GroupBox.qml4
-rw-r--r--src/imports/controls/fusion/GroupBox.qml4
-rw-r--r--src/imports/controls/imagine/GroupBox.qml4
-rw-r--r--src/imports/controls/material/GroupBox.qml4
-rw-r--r--src/imports/controls/universal/GroupBox.qml4
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp1
6 files changed, 11 insertions, 10 deletions
diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml
index c97eeba3..c82e9b35 100644
--- a/src/imports/controls/GroupBox.qml
+++ b/src/imports/controls/GroupBox.qml
@@ -43,13 +43,13 @@ T.GroupBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth,
- label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ implicitLabelWidth + leftPadding + rightPadding,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding)
spacing: 6
padding: 12
- topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+ topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
label: Text {
x: control.leftPadding
diff --git a/src/imports/controls/fusion/GroupBox.qml b/src/imports/controls/fusion/GroupBox.qml
index c270403b..ca7f2e2a 100644
--- a/src/imports/controls/fusion/GroupBox.qml
+++ b/src/imports/controls/fusion/GroupBox.qml
@@ -45,13 +45,13 @@ T.GroupBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth,
- label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ implicitLabelWidth + leftPadding + rightPadding,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding)
spacing: 6
padding: 9
- topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+ topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
label: Text {
x: control.leftPadding
diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml
index d18af5ba..af6e2376 100644
--- a/src/imports/controls/imagine/GroupBox.qml
+++ b/src/imports/controls/imagine/GroupBox.qml
@@ -44,11 +44,11 @@ T.GroupBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth,
- label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ implicitLabelWidth + leftPadding + rightPadding,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding)
- topPadding: (background ? background.topPadding : 0) + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+ topPadding: (background ? background.topPadding : 0) + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
leftPadding: background ? background.leftPadding : 0
rightPadding: background ? background.rightPadding : 0
bottomPadding: background ? background.bottomPadding : 0
diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml
index 7edb26f2..78e9c29e 100644
--- a/src/imports/controls/material/GroupBox.qml
+++ b/src/imports/controls/material/GroupBox.qml
@@ -43,13 +43,13 @@ T.GroupBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth,
- label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ implicitLabelWidth + leftPadding + rightPadding,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding)
spacing: 6
padding: 12
- topPadding: Material.frameVerticalPadding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+ topPadding: Material.frameVerticalPadding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
bottomPadding: Material.frameVerticalPadding
label: Text {
diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml
index 09379bd2..1fe45dfd 100644
--- a/src/imports/controls/universal/GroupBox.qml
+++ b/src/imports/controls/universal/GroupBox.qml
@@ -42,13 +42,13 @@ T.GroupBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth,
- label ? label.implicitWidth + leftPadding + rightPadding : 0,
+ implicitLabelWidth + leftPadding + rightPadding,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight, contentHeight + topPadding + bottomPadding)
spacing: 12
padding: 12
- topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
+ topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
label: Text {
x: control.leftPadding
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index 088b6552..df053b70 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -338,6 +338,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickControl, 5>(uri, 2, 5, "Control");
qmlRegisterType<QQuickContainer, 5>(uri, 2, 5, "Container");
qmlRegisterType<QQuickDialog, 5>(uri, 2, 5, "Dialog");
+ qmlRegisterType<QQuickGroupBox, 5>(uri, 2, 5, "GroupBox");
qmlRegisterType<QQuickPage, 5>(uri, 2, 5, "Page");
qmlRegisterType<QQuickPopup, 5>(uri, 2, 5, "Popup");
qmlRegisterType<QQuickPopupAnchors>();