i have two classes one is main window and i promoted my custom widget to the other class. Now i want to show the coordinates of the Custom Widget in a line edit which is in my main window on mouse move event. I implimented the mouse move event and it is showing coordinate on the tool tip i.e where ever my cursor point in the custom widget coordinate are displayed along the cursor.
Now i want these coordinates to be displayed in a list box.
here is my code :
SRP_Plot_widget
void SRP_Plot_widget::mouseMoveEvent ( QMouseEvent * event )
{
MainWindow obj;
QPointF position = event->posF();
double x = event->pos().x()/SRP_scaleX;
double y= event->pos().y()/SRP_scaleY;
QToolTip::showText(event->globalPos(), QString::number(x ) + ", " + QString::number( y ));
}
now i want this information in lie edit which is in mainwindow.
Bookmarks