summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-16 01:00:49 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-16 01:00:49 +0200
commitfaab18c65ab63617c2e03a27a7a03dfae050292f (patch)
tree891a02e8876ee84d999d7d172f0f7c38d174366d /src/widgets/styles/qstylesheetstyle.cpp
parent06ca5c49e7fb6dd23eab3a02de404c82e03bc5db (diff)
parent9cc040a806fd2e6f1458e801a99311168d594c77 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-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();