Problem in MouseMove Event
i want to Get the position( x,y) of the cursor moving on my custom QGraphicsView Control
So, i made new class "MyQGraphicsView : QGraphicsView"
then i defined and implemented "mouseMoveEvent"
in MyQGraphicsView .h
in MyQGraphicsView.cpp
Code:
void MyGraphicsViwer
::mouseMoveEvent ( QMouseEvent * event
) {
MainForm
->ui.
Txt_xValue->setText
((QString::number)(x
()));
}
the problem is in the first mouse move, the Txt_xValue displays value 100, then it doesn't change where ever the mouse moves.
So ?
Thanks :)
Re: Problem in MouseMove Event
Code:
viewport()->setMouseTracking(true);
Re: Problem in MouseMove Event
Thanks for your reply, but .. it still not working.
still displaying the same result "100"
Re: Problem in MouseMove Event
Re: Problem in MouseMove Event
Thanks A lot jpn, Worked :)