set a tooltip only when the main text is elided
BUG: 189716 svn path=/trunk/KDE/kdelibs/; revision=964973
This commit is contained in:
parent
359dc82a14
commit
92b51d7751
@ -738,9 +738,13 @@ QSizeF IconWidgetPrivate::layoutText(QTextLayout &layout, const QStyleOptionGrap
|
||||
const QSizeF size = layoutText(layout, text, constraints.width());
|
||||
|
||||
if (size.width() > constraints.width() || size.height() > constraints.height()) {
|
||||
if (action) {
|
||||
q->setToolTip(action->text());
|
||||
}
|
||||
const QString elided = elidedText(layout, option, constraints);
|
||||
return layoutText(layout, elided, constraints.width());
|
||||
}
|
||||
q->setToolTip(QString());
|
||||
|
||||
return size;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user