parser = selectParser();try {prepareOperations();model.Load(fileName);}catch(const FileOpenEx &){}gl->setDefaultView();
prepare();myObj.clear();myObj = parser->parse(fileName); // emit signals on assignemit ...emit ...
C++ (Qt)#include <QCoreApplication>#include <QtConcurrent/QtConcurrent>#include <iostream> using namespace std; void f() { cout << "ololo" << endl;}void d() { cout << "done" << endl;} int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); auto future = QtConcurrent::run(f); QFutureWatcher<void> watcher; future.waitForFinished(); QObject::connect(&watcher, &QFutureWatcher<void>::finished, []{d();}); watcher.setFuture(future); return a.exec();}