When I have code like this:
QNetworkReply* reply = netWorkMansger.post(...);
connect(reply,&QNetworkReply::finished,[=](){//Handler code});
What if between the first and second line the reply gets finished? Than the connect comes to late, does it not?
The connect() would be indeed too late if the reply would ever emit finished() during creation, before the reply pointer is returned to the caller of post().
QNetworkReply/QNetworkAccessManager don’t do that though, the start of the reply’s network operation is queued in the event loop, i.e. the operation won’t start before your code returns to the event loop or events are otherwise processed (otherwise means one explicitly calls one of a few nasty methods like QDialog::exec()/QMessageBox::critical etc., QEventLoop::exec(), or processEvents()). Thus your code is safe if you connect to the reply right away.
Not emitting signals like finished() synchronously at the time an asynchronous operation is started is in my opinion one of the most important rules when implementing such operations.