PDA

View Full Version : Performance issues with detached QProcess



simon71717
14th January 2014, 23:56
Hi everyone,

I’ve built an interface in Qt which interacts with a camera and a projector for synchronized image capture. I am using a button linked to a QProcess command on the interface to launch an external process which sends images to the projector to trigger image capture.

The issue is that, when I launch the process from this interface, the OpenGL instance created by the external process suffers greatly in performance, resulting in botched image captures. Such a performance drop is not experienced when running the process by itself. The only thing that I think might affect the new process is the 2 OpenGL instances running in the interface, but the external process itself does not do much processing at all: it just draws a square, binds a PNG image onto the surface, and refreshes at 60 Hz for all PNG images.

I was wondering if this is an issue with the way I have launched the program, or if its due to hardware limitations (the workstation does not have the highest specs. Thanks in advance! My launching code is included below:



bool bStartSuccess;
QString sProgram = CASIO_EXE_PATH;
QString sProgramDir = CASIO_EXE_DIR;
QStringList arguments;
arguments << QString("%1").arg(pattern_list.count());
QString sOldPath = QDir::currentPath();
QDir::setCurrent( sProgramDir );
QProcess *process = new QProcess(this);
bStartSuccess = process->startDetached(sProgram, arguments);
QDir::setCurrent(sOldPath);

anda_skoa
15th January 2014, 11:07
Such a performance drop is not experienced when running the process by itself.

Is your application running at the same time and doing something? Or just the other process?





QProcess *process = new QProcess(this);
bStartSuccess = process->startDetached(sProgram, arguments);


No need for a new QProcess, startDetached() is a static method.

Cheers,
_