Hi,
I am re-posting my question. This time I hope I am more clear.
In my GraphicView I have an event:
{
if (e->buttons().testFlag(Qt::MidButton))
{
double rad = 2;
this
->Scene
->addEllipse
(pt.
x()-rad, pt.
y()-rad, rad
*2.0, rad
*2.0,myPen,
QBrush(Qt
::SolidPattern));
this->list.append(pt);
}
}
void MyGraphicsView::mousePressEvent(QMouseEvent * e)
{
if (e->buttons().testFlag(Qt::MidButton))
{
double rad = 2;
QPointF pt = mapToScene(e->pos());
QPen myPen = QPen(Qt::red);
this->Scene->addEllipse(pt.x()-rad, pt.y()-rad, rad*2.0, rad*2.0,myPen, QBrush(Qt::SolidPattern));
this->list.append(pt);
}
}
To copy to clipboard, switch view to plain text mode
I want to create a connection between my main window's QLabel and MyGraphicsView::list.append(pt); that every time a new value is added to the list, pt will be printed on QLabel of the main window.
I can create a slot in my main window that will print a string on QLabel but I don't know what will be my signal and how the connection command will be look like.
Basically, I don't know how to create a signal when a list is updated.
I hope I can get help on this matter.
Thank,
Bookmarks