PDA

View Full Version : Is there a common way of setting an event loop manually?



Patrick Sorcery
14th February 2011, 01:56
Hello~ here I come again~

This problem takes place when using Qt+MPI. I want Prcess0 to display the windows, while other processes just wait for command (RMI of VTK) in an event loop.

Now I'm solving it in this way: all processes had a Qt Mainwindow in main.cpp, and only Process0 shows it. The disadvantage is that all nodes of the cluster have to start X-window system. So I just wonder what's the easiest way of setting an event loop. BTW, I hope it can be used both on Linux & Windows, so a way of standard C++ itself will be nice.

Thanx a lot! Happy Valentine's Day:p

ChrisW67
14th February 2011, 04:30
If you don't want a GUI on a Qt application then use QCoreApplication and not QApplication. If the logic of your program is buried in a QMainWindow sub-class then you will need change that as well.