Fusion style: Fix menu item text being elided when mnemonic and && appear in the text
Pass the text flags to fontMetrics.elidedText(). Amends 0c0892a3e20aa1fa79e3561de9b8e1fa8820f062. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-94481 Fixes: QTBUG-103836 Change-Id: I21a9b96ef69e5a5e612a0bdbdf44e5a20931eb59 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
1227af2635
commit
539815569f
@ -1691,7 +1691,8 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
|
||||
p->setFont(font);
|
||||
const QFontMetrics fontMetrics(font);
|
||||
const QString textToDraw = fontMetrics.elidedText(s.left(tabIndex).toString(),
|
||||
Qt::ElideMiddle, vTextRect.width());
|
||||
Qt::ElideMiddle, vTextRect.width(),
|
||||
text_flags);
|
||||
if (dis && !act && proxy()->styleHint(SH_EtchDisabledText, option, widget)) {
|
||||
p->setPen(menuitem->palette.light().color());
|
||||
p->drawText(vTextRect.adjusted(1, 1, 1, 1), text_flags, textToDraw);
|
||||
|
Loading…
x
Reference in New Issue
Block a user