diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-06-09 14:17:29 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2020-06-10 12:32:58 +0000 |
commit | 729d147a57cc47864f833273fde18f0335fb9655 (patch) | |
tree | 556d82d9412a8d15f68613b8cad5fabdc75446d6 /src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp | |
parent | 94268de55368b9f433d78effad132d1370054286 (diff) |
Fix issues with the label in GroupBox
1. Make it have the correct position, given by the labelPos
property.
2. Put a Rectangle with the background color below the label to wipe
away the frame strikethrough.
Change-Id: I68b6f1b5fda7854f7032dd9716613d025d2eb6ed
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp')
-rw-r--r-- | src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp b/src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp index 2b4154d2..d62b6f23 100644 --- a/src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp +++ b/src/imports/nativestyle/items/qquickstyleitemgroupbox.cpp @@ -68,6 +68,10 @@ StyleItemGeometry QQuickStyleItemGroupBox::calculateGeometry() if (m_groupBoxPadding != oldGroupBoxPadding) emit groupBoxPaddingChanged(); + const QPointF oldLabelPos = m_labelPos; + m_labelPos = style()->subControlRect(QStyle::CC_GroupBox, &styleOption, QStyle::SC_GroupBoxLabel).topLeft(); + if (m_labelPos != oldLabelPos) + emit labelPosChanged(); return geometry; } @@ -89,3 +93,8 @@ QQuickStyleMargins QQuickStyleItemGroupBox::groupBoxPadding() const { return m_groupBoxPadding; } + +QPointF QQuickStyleItemGroupBox::labelPos() const +{ + return m_labelPos; +} |