]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/ktooltip.cpp
QAbstractItemView::scrollTo() may get called by QListView::keyPressEvent(), so m_enab...
[dolphin.git] / src / ktooltip.cpp
index 3c1da3fba409fd2d5f23c798087467cc9a95286a..a0126fbffecdcc976660dd64b266aebcd3ab14ef 100644 (file)
@@ -95,6 +95,7 @@ QVariant KToolTipItem::data(int role) const
 void KToolTipItem::setData(int role, const QVariant &data)
 {
     d->map[role] = data;
+    KToolTipManager::instance()->update();
 }
 
 
@@ -149,11 +150,7 @@ void KToolTipDelegate::paint(QPainter *painter, const KStyleOptionToolTip *optio
     else
         path.addRect(option->rect.adjusted(0, 0, -1, -1));
 
-#if QT_VERSION >= 0x040400
     QColor color = option->palette.color(QPalette::ToolTipBase);
-#else
-    QColor color = option->palette.color(QPalette::Base);
-#endif
     QColor from = color.lighter(105);
     QColor to   = color.darker(120);
 
@@ -471,6 +468,7 @@ void KToolTipManager::showTip(const QPoint &pos, KToolTipItem *item)
     hideTip();
     label->showTip(pos, item);
     currentItem = item;
+    m_tooltipPos = pos;
 }
 
 void KToolTipManager::hideTip()
@@ -509,6 +507,13 @@ void KToolTipManager::setDelegate(KToolTipDelegate *delegate)
     m_delegate = delegate;
 }
 
+void KToolTipManager::update()
+{
+    if (currentItem == 0)
+        return;
+    label->showTip(m_tooltipPos, currentItem);
+}
+
 KToolTipDelegate *KToolTipManager::delegate() const
 {
     return m_delegate;