summaryrefslogtreecommitdiffstats
path: root/src/kbstatustip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kbstatustip.cpp')
-rw-r--r--src/kbstatustip.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/kbstatustip.cpp b/src/kbstatustip.cpp
new file mode 100644
index 0000000..cb50edf
--- /dev/null
+++ b/src/kbstatustip.cpp
@@ -0,0 +1,35 @@
+//
+// C++ Implementation: kbstatustip
+//
+// Description:
+//
+//
+// Author: Magnus Kulke <mkulke@magnusmachine>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include <qcursor.h>
+
+#include "kbstatustip.h"
+
+KbStatusTip::KbStatusTip(QWidget * widget) : QToolTip(widget)
+{
+}
+
+void KbStatusTip::maybeTip(const QPoint &)
+{
+ tip(parentWidget()->rect(), "kasablanca");
+}
+
+void KbStatusTip::ShowStatus(QString msg)
+{
+ if ((QCursor::pos().x() > parentWidget()->mapToGlobal(parentWidget()->pos()).x())
+ && (QCursor::pos().y() > parentWidget()->mapToGlobal(parentWidget()->pos()).y())
+ && (QCursor::pos().x() < (parentWidget()->mapToGlobal(parentWidget()->pos()).x() + parentWidget()->width()))
+ && (QCursor::pos().y() < (parentWidget()->mapToGlobal(parentWidget()->pos()).y() + parentWidget()->height())))
+ {
+ tip(parentWidget()->rect(), msg);
+ }
+}