[Kst] extragear/graphics/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Jul 22 20:50:30 CEST 2005


SVN commit 437693 by arwalker:

BUG:104347 Add tooltips.

 M  +13 -4     statuslabel.cpp  


--- trunk/extragear/graphics/kst/kst/statuslabel.cpp #437692:437693
@@ -36,7 +36,7 @@
 }
 
 void StatusLabel::setFullText() {
-  QToolTip::remove( this );
+  QToolTip::remove(this);
   QToolTip::hide();
   
   setMaximumWidth(32767);  
@@ -46,16 +46,25 @@
 void StatusLabel::setTextWidth(const QFontMetrics &metrics, int width) {
   QString str;
   
+  QToolTip::remove(this);
+  
   if (width < 0) {
     width = 0;
   }
+  
   setMaximumWidth(width);
+  
   str = KStringHandler::rPixelSqueeze(_fullText, metrics, width);
   if (str.length() > _fullText.length()) {
-    setText(i18n("ellipsis","..."));
-  } else {
-    setText(str);
+    //
+    // required because of a bug in KStringHandler that returns _fullText appended by ...
+    // 
+    QToolTip::add(this, _fullText);  
+    str = i18n("ellipsis","...");
+  } else if (str != _fullText) {
+    QToolTip::add(this, _fullText);  
   }
+  setText(str);
 }
 
 void StatusLabel::setFullText(const QString &text) {


More information about the Kst mailing list