Thanks. I added the signal to MyGraphicView class and emitted it as you suggested. My connection statement looks like:
QObject::connect(ui->widget1, SIGNAL(pointAdded(const QPointF &point)), ui->label1, SLOT(printPointCoordinates(QPointF pt)));
The project is built with no errors but when I run it I am getting this message:
QObject::connect: No such signal MyGraphicsView:ointAdded(const QPointF &point) in ..\graphicsviewer_app\mainwindow.cpp:22
QObject::connect: (sender name: 'widget1')
QObject::connect: (receiver name: 'label1')
My slot in the main window is:
void MainWindow:rintPointCoordinates(QPointF pt)
{
qDebug()<<"Into printPointCoordinates";
QString str = "( " + QString::number((int)pt.x())+ ", " + QString::number((int)pt.y())+ " )";
ui->label1->setText(str);
}
What do you think is the problem?
Thanks
Bookmarks