c++ - How to Run a whole QApplication Asynchronously? -
i'm trying run modified qt-programm library. need not not block main execution.
so want run qapplication , commence execution of main application. how achive this?
my first thought run in seperate thread.
void myclass::execute() { someclass = someclass::instance(); std::thread t1(&myclass::startapp, this); someclass->somefunction(); someclass->domorestuff(); } void myclass::startapp() { qapplication app(argc, argv); app.exec(); qcoreapplication::quit(); }
but results in call '__invoke' ambiguous
error. though don't know why/where __invoke
overwritten , how handle error. :(
so how can accomplish qapplication doesn't block main execution?
design pattern totally wrong, qapplication qcoreapplication not supposed multiplied inside 1 application. should example make own class like:
class librarycore: public qobject { }
and substitute qapplication class inside future library sources. should implement needed methods in librarycore (ones used inside application) making them work properly..
Comments
Post a Comment