I have developed a QT GUI, which has a "Start Tests" Push button. When this push button is clicked I call a perl script [using 'system' command], which initiates tests. My question is that when I call the perl script, my GUI tends to hang. These are the questions I have: a) How do I call a perl script from the QT GUI but the idea is that it should not hang my GUI. I see the GUI getting hung up until the perl script exits. b) Is there any provision to call the perl script and make the GUI exit instead of waiting for the perl script to exit?

Thanks!

有帮助吗?

解决方案

Use QProcess, instead of the system command so that it runs asynchronously.

If you call the startDetached() function of QProcess and waitforStarted(), you can then exit your Qt application and leave the perl script running.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top