Qt signal slot connection - QNetworkAccessManager -


im new in qt , im trying understand following signal-slot connection:

m_networkmanager = new qnetworkaccessmanager(this); qnetworkreply *reply = m_networkmanager->get(request); connect(reply, signal(finished()),this, slot(onrequestcompleted())); 

why connect "finished" signal after get-request?...what happened, if network connection in line-2 faster executed before slot connection (line-3) made?

i know, code work. want understand how possible :)

it's not possible finished() signal emit because haven't yielded event loop yet. if somehow request got sent , came back, code still executing , continue execute until you've yielded event loop. reply object ever chance anything, such parsing response , emitting corresponding signal.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -