QToolButton: Elide text when constraints prevent from showing whole text
Follow-up of b2a282d7c7 - elide the text
also when the QToolButton has no icon (=text only)
Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-64132
Change-Id: If4d3758452f37df411931a6628846988a3418d8e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
parent
95ba368806
commit
021906f6c9
|
|
@ -1668,8 +1668,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
|
|||
alignment |= Qt::TextHideMnemonic;
|
||||
rect.translate(shiftX, shiftY);
|
||||
p->setFont(toolbutton->font);
|
||||
const QString text = d->toolButtonElideText(toolbutton, rect, alignment);
|
||||
proxy()->drawItemText(p, rect, alignment, toolbutton->palette,
|
||||
opt->state & State_Enabled, toolbutton->text,
|
||||
opt->state & State_Enabled, text,
|
||||
QPalette::ButtonText);
|
||||
} else {
|
||||
QPixmap pm;
|
||||
|
|
|
|||
Loading…
Reference in New Issue