aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Brauch <svenbrauch@googlemail.com>2013-08-14 14:31:10 (GMT)
committerSven Brauch <svenbrauch@googlemail.com>2013-08-15 10:22:08 (GMT)
commit93da1d1d18ea594be9fdb42a9789247de0f18397 (patch)
treed28bcca40fcfad19787e02cd691cfbe6306f97f9
parentb2c9e8c167d85317375be244a407045c02fa6745 (diff)
Finish implementation of the TextHintInterface
... started in 2003, never completed ;) REVIEW:112083
-rw-r--r--part/view/kateviewinternal.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/part/view/kateviewinternal.cpp b/part/view/kateviewinternal.cpp
index c013097..b4b8c5a 100644
--- a/part/view/kateviewinternal.cpp
+++ b/part/view/kateviewinternal.cpp
@@ -54,6 +54,7 @@
#include <QtGui/QPixmap>
#include <QtGui/QKeyEvent>
#include <QtGui/QLayout>
+#include <QToolTip>
static const bool debugPainting = false;
@@ -2827,9 +2828,12 @@ void KateViewInternal::mouseMoveEvent( QMouseEvent* e )
//and we will create invalid text hint requests if we don't check
if (m_textHintEnabled && geometry().contains(parentWidget()->mapFromGlobal(e->globalPos())))
{
- m_textHintTimer.start(m_textHintTimeout);
- m_textHintMouseX=e->x();
- m_textHintMouseY=e->y();
+ if ( QToolTip::isVisible() ) {
+ QToolTip::hideText();
+ }
+ m_textHintTimer.start(m_textHintTimeout);
+ m_textHintMouseX=e->x();
+ m_textHintMouseY=e->y();
}
}
}
@@ -3053,7 +3057,11 @@ void KateViewInternal::textHintTimeout ()
emit m_view->needTextHint(c, tmp);
- if (!tmp.isEmpty()) kDebug(13030)<<"Hint text: "<<tmp;
+ if (!tmp.isEmpty()) {
+ kDebug(13030) << "Hint text: " << tmp;
+ QPoint pos(startX() + m_textHintMouseX, m_textHintMouseY);
+ QToolTip::showText(mapToGlobal(pos), tmp);
+ }
}
void KateViewInternal::focusInEvent (QFocusEvent *)