summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-17 01:01:01 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-17 01:01:01 +0200
commit6f27bb135246b7fe9d11ba58e05d2b7661bc2080 (patch)
tree9704e1c4ffb775472a9984872c3bd292faa999a5 /src/widgets/styles
parentdc4212b3a694e143595968419ae5ad695ab2aa03 (diff)
parentc222a9283d94ad1e29334bb2fba0beef7cc716c7 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 88c6c288e8..3f57992311 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5035,6 +5035,14 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || subRule.hasFont) {
sz = subRule.adjustSize(csz);
+ if (!sz.isValid()) {
+ // Try to set the missing values based on the base style.
+ const auto baseSize = baseStyle()->sizeFromContents(ct, opt, sz, w);
+ if (sz.width() < 0)
+ sz.setWidth(baseSize.width());
+ if (sz.height() < 0)
+ sz.setHeight(baseSize.height());
+ }
if (!subRule.hasGeometry()) {
QSize nativeContentsSize;
bool nullIcon = hdr->icon.isNull();