Going through the phantomJS code i ran into this in the webpage.cpp file (line 315)
connect(m_networkAccessManager, SIGNAL(resourceRequested(QVariant)),
SIGNAL(resourceRequested(QVariant)));
And i don’t quite understand how this works, i’m aware that you can connect signals to signals in Qt.
On the Qt documentation i found out that you can also connect signals directly to a method (http://doc.qt.io/qt-5/qobject.html#connect-2) , seeing that it’s a 3 parameters call i thought that this would be the desired function on the webpage.cpp code, but connecting a signal to the same signal…i got completely lost there, any help?
PD: not very experienced in Qt i should say, sorry if it’s a dumb question
Three parameters QObject::connect()
is an equivalent of
Thus,
QNetworkAccessManager::resourceRequested(QVariant)is connected toWebPage::resourceRequested(QVariant)and cause the latter to be emitted every time when the former is emitted.More details in Qt documentation