summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-19 08:14:31 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-02-19 22:21:30 +0100
commit4c6579eacded086ad014b0fd2432095362c1d131 (patch)
tree8d05881925732345d309bc605c77dd5e7bf9dfc1 /src/plugins/styles
parent6172f3101e6606d48cca8424c5472af1daeefc17 (diff)
Unbreak binary compatibility in QStyleOptionHeader
4d943846128118e1b9932a17ce6f977a0f4127a5 introduced a new data member to QStyleOptionHeader, and reduced the size of the orientation member. This changed the binary layout of class instances, and breaks ABI. 180c662b0790c6eceffdcb4661681d7df1541a2d added another member within the new bitfield. Introduce a new QStyleOptionHeaderV2 class instead with the new members, and use that in QHeaderView, and the styles using the new members. Fixes: QTBUG-91224 Pick-to: 6.1 Change-Id: I47e6841e6652e4b67f247b7b4514e90be5609156 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 7b3709459d..dad81dc8a1 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -3565,8 +3565,10 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
textr.translate(pixmap.width() / pixmap.devicePixelRatio() + 2, 0);
}
QString text = header->text;
- if (header->textElideMode != Qt::ElideNone)
- text = header->fontMetrics.elidedText(text, header->textElideMode, textr.width());
+ if (const QStyleOptionHeaderV2 *headerV2 = qstyleoption_cast<const QStyleOptionHeaderV2 *>(header)) {
+ if (headerV2->textElideMode != Qt::ElideNone)
+ text = header->fontMetrics.elidedText(text, headerV2->textElideMode, textr.width());
+ }
proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette,
header->state.testFlag(State_Enabled), text, QPalette::ButtonText);