![]() moveToThread( QApplication:: instance()-> thread() ) If you need to create QWidget(or some other gui component(s)) in different(non-main) thread(s) you can implement it in such way:Ĭreate simple wrapper which holds gui component: // gui component holder which will be moved to main thread class gui_launcher : public QObjectĬreate QApplication object in main thread Tags : c++,multithreading,qt,user-interface The problem is that the source has multiple threads each of which may need to popup its own message. However, I get an error before I even get to that call: ASSERT failure in QWidget: "Widgets must be created in the GUI thread." ![]() I tried creating a thread and then calling this->exec() in the run function. I have an application in which each thread (except the main thread) needs to create its own window.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |