Creating Slots for numerous loadProgress signals of an array of QWebEnginePage objects.
-
I have a
QList<QWebEnginePage*>
that is connected toQWebEnginePage::loadProgress
withconnect(qListContainer[i], &QWebEnginePage::loadProgress, this, &MainWindow::loadProgressSlot)
This is accomplished with afor()
loop for everyQWebEnginePage*
in my QListI want to create a slot for every connected QWebEnginePage. I cannot foresee how many slots I will need. Is there a way to create these slots iteratively? Is there a better solution for individually connecting the
&QWebEnginePage::loadProgress
signal to multiple slots updating individual progress bars?Thanks.
-
@desun_evan
In MainWindow::loadProgressSlot()
you can test the sender of the signal and update your progress bars accordingly:if(sender()==qListContainer[0]) update progressbar0
else... -