Trying to connect a signal so that when a login is validated in the main window class, a signal is inherited into a derived shape class to draw a line in a QEvent loop. However, the connect function is giving an error. No matching function for call to ‘connect’.
//Function for line paint event
void Line::paintEvent(QPaintEvent *event)
{
QPainter *myline = new QPainter(this);
//QPainter myline(this);
QPen linePen(Qt::green);
linePen.setWidth(10);
myline->setPen(linePen);
QEventLoop loop;
connect(myline, SIGNAL(shapeValue()), &loop, SLOT(quit()), Qt::QueuedConnection);
loop.exec();
QLineF line(10.0, 80.0, 90.0, 20.0);
myline->drawLine(50, 50, 200, 200);
show();
}
New contributor
benjamin morenus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.