My example:
Qt Code:
  1. void funcMain()
  2. {
  3. QFtp * ftp = new QFtp(this);
  4. connect(ftp, SIGNAL(listInfo(QUrlInfo)),
  5. this, SLOT(addToList(QUrlInfo)));
  6. .....
  7. ftp->list(); // emit signal listInfo();
  8. .....
  9. return;
  10. }
  11.  
  12. void addToList(QUrlInfo info)
  13. {
  14. //do something
  15. }
To copy to clipboard, switch view to plain text mode 

When debug, SLOT(addToList) is invoked after funcMain() return. But i want addToList() to be invoked right after statement ftp->list() finish and before funcMain return , so what should i do ? And signal listInfo() is emitted while invoking ftp->list() or after ftp->list() finish or after funcMain() return ?