Hello guys,

i have a question relating QEventloop class. During my initialisation routine some functions should be started sequentially. To gaurantee that i wrote this peace of code:

Qt Code:
  1. //mainwindow.cpp
  2.  
  3. void MainWindow::doInit()
  4. {
  5. connect(this, SIGNAL(Function1Complete()), &loop, SLOT(quit()));
  6.  
  7. qDebug() << "Step1";
  8. StartFuntion1();
  9. loop.exec();
  10. qDebug() << "Step2";
  11. StartFuntion2();
  12. }
  13.  
  14. void MainWindow::StartFuntion1()
  15. {
  16. ...
  17. emit Function1Complete();
  18. }
  19.  
  20. //mainwindow.h
  21. ...
  22. signals:
  23. void Function1Complete();
To copy to clipboard, switch view to plain text mode 

But when i run my code "Step2" is never reached. When i emit "Function1Complete" with an additional button like this
Qt Code:
  1. void MainWindow::handle_btnTest()
  2. {
  3. emit Function1Complete();
  4. }
To copy to clipboard, switch view to plain text mode 
my eventloop quits properly and everything works fine. Any ideas about that?