From 92b51d7751ccfa236c91e53c88f0a8ce9271c36e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 May 2009 18:49:22 +0000 Subject: [PATCH] set a tooltip only when the main text is elided BUG: 189716 svn path=/trunk/KDE/kdelibs/; revision=964973 --- widgets/iconwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index 7be42388a..6498cbd5f 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -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; }