I'm beggining with Qt and I'm currently adapting a command-line program to use it with a GUI.
I'm building my GUI like this :
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
I want to process some events permanently. In command line, I used a while loop, it work perfectly. Using Qt, I don't know how I can process these events properly. So I tried to use a std::thread, but my Qt app crashes when I try to modify the GUI from the thread. Same problem using QThread. I don't need threading, so it would be great if I can just put my code in the Qt's main thread.
Anyone can help me please ?