Could you prepare a minimal compilable example reproducing the problem?
Could you prepare a minimal compilable example reproducing the problem?
christina123y (8th March 2009)
Do you mean that absolutely nothing is output to the console or only no coordinates?
Because there won't be any coordinates output as long as you don't ask for them.
qDebug() << "mouse move " << endl;
should be:
qDebug() << "mouse move " << point.x() <<", "<<point.y()<<")"<<endl;
christina123y (8th March 2009)
Thank you for your reply. No,I mean I write some qdebug information in mousePressEvent function of Cordinate class. and I also write some qdebug information in mouseMoveEvent funciton of Cordinate class, and Cordinate class which has been called and inherit from QGraphicsItem ,and can draw coordinate system on QGraphicsView. and when i press mouse on the view, the Cordinate::mousePressEvent is called,so it can console the information which i had wrote.
but the information i had wrote in the Cordinate::mouseMoveEvent function cann't be consoled. I think this function hasn't been called. What i want to is to track mouse move information,such as mouse position in the Cordinate. How can Cordinate::mouseMoveEvent can be called ? Because i think the mouse position information code must be written in this (Cordinate::mouseMoveEvent) function.
Thank you for your answer,here is my simple test code .Just in the other computer,it's run correctly.But when copy it to my computer,I don't know why there didn't draw graph ,only draw cordinate.This mean that Cordinate class 's sub item didn't had been executed.Why?And the Cordinate class's mousePressEvent and mouseMoveEvent hasn't been done?
Where, this code run in the other computer, it can print out mouse press info.but can't print out mouse move info.
I want to track mouse move position.How can do this success? Wish anyone's help and appreciate very much!
Last edited by christina123y; 8th March 2009 at 08:06.
Bookmarks