Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Line drawing with mouse coordinate in Qt
This code will show you the line drawing in the QGraphicsScene by getting the end points of line with the help of mouseMove() Event.
When the mouse is moved on the widget at that time the mouse coordinates are catched and use to draw line from center to that specific coordinate.
class EVE1 : public QWidget
EVE1(QWidget *parent = 0);
void mouseMoveEvent(QMouseEvent *);
#endif // EVE1_H
setMouseTracking(1);//Enable Mouse tracking on widget.
// No need to delete any object that has got a parent which is properly deleted.
void EVE1::mouseMoveEvent(QMouseEvent *event)
NOTE:MOVE YOUR MOUSE AROUND THE WIDGET, NOT ON THE WIDGET....