T.I.M
15th April 2009, 08:29
Hi all,
I have a QLabel and I want that, that QLabel follow the mouse movement of the user.
Currently I have the following Code:
label = new QLabel(this);
void CSomeClass::mouseMoveEvent( QMouseEvent *event )
{
QPoint currentPos = QWidget::mapFromGlobal(QCursor::pos());
int x = currentPos.x();
int y = currentPos.y();
label->setText("testje");
label->setGeometry(x,y, 50, 50);
label->show();
}
Problem
This works fine but the problem is that the movement is too slow!
The text halts everytime.
Does anyone know how to solve this?
How do I get a mouse movement with text beneath that follows directly the cursor?
Thanx!
I have a QLabel and I want that, that QLabel follow the mouse movement of the user.
Currently I have the following Code:
label = new QLabel(this);
void CSomeClass::mouseMoveEvent( QMouseEvent *event )
{
QPoint currentPos = QWidget::mapFromGlobal(QCursor::pos());
int x = currentPos.x();
int y = currentPos.y();
label->setText("testje");
label->setGeometry(x,y, 50, 50);
label->show();
}
Problem
This works fine but the problem is that the movement is too slow!
The text halts everytime.
Does anyone know how to solve this?
How do I get a mouse movement with text beneath that follows directly the cursor?
Thanx!