summaryrefslogtreecommitdiffstats
path: root/src/kbstatustip.cpp
blob: cb50edfefef4a368c7b09709354f2128ac4b0083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);
	}
}