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
void mouseMoveEvent ( QMouseEvent * event);
To copy to clipboard, switch view to plain text mode
in MyQGraphicsView.cpp
void MyGraphicsViwer
::mouseMoveEvent ( QMouseEvent * event
) {
MainForm
->ui.
Txt_xValue->setText
((QString::number)(x
()));
}
void MyGraphicsViwer::mouseMoveEvent ( QMouseEvent * event )
{
MainForm->ui.Txt_xValue->setText((QString::number)(x()));
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks