#include "ktooltip_p.h"
+// compile with XShape older than 1.0
+#ifndef ShapeInput
+const int ShapeInput = 2;
+#endif
+
class KToolTipItemPrivate
{
KToolTipItem::~KToolTipItem()
{
+ delete d;
}
int KToolTipItem::type() const
void KToolTipItem::setData(int role, const QVariant &data)
{
d->map[role] = data;
+ KToolTipManager::instance()->update();
}
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);
KToolTipManager *KToolTipManager::s_instance = 0;
KToolTipManager::KToolTipManager()
- : label(0), currentItem(0)
+ : label(0), currentItem(0), m_delegate(0)
{
#ifdef Q_WS_X11
Display *dpy = QX11Info::display();
hideTip();
label->showTip(pos, item);
currentItem = item;
+ m_tooltipPos = pos;
}
void KToolTipManager::hideTip()
m_delegate = delegate;
}
+void KToolTipManager::update()
+{
+ if (currentItem == 0)
+ return;
+ label->showTip(m_tooltipPos, currentItem);
+}
+
KToolTipDelegate *KToolTipManager::delegate() const
{
return m_delegate;