Hello. I am trying to call the eog command (it's an image viewing software) from my Qt application. This is the code.
void MainWindow::doRawViewer(){
this,
tr("Required Save"),
tr("Save the image first in order to view this image under the system's default image viewer"));
if (fileName.isNull())
return;
#if defined(Q_OS_WIN32)
viewImageProcess.start(fileName);
#elif defined(Q_OS_LINUX)
viewImageProcess.
execute(QString("eog ") + fileName
);
// viewImageProcess.start(QString("eog ") + fileName);
#endif
}
void MainWindow::doRawViewer(){
QMessageBox::information(
this,
tr("Required Save"),
tr("Save the image first in order to view this image under the system's default image viewer"));
QString fileName = doRawSave();
if (fileName.isNull())
return;
QProcess viewImageProcess(0);
#if defined(Q_OS_WIN32)
viewImageProcess.start(fileName);
#elif defined(Q_OS_LINUX)
viewImageProcess.execute(QString("eog ") + fileName);
// viewImageProcess.start(QString("eog ") + fileName);
#endif
}
To copy to clipboard, switch view to plain text mode
eog runs properly and it correctly displays the image, the problem is when I close eog, my Qt application hangs. Is this a memory problem or I'm just not using QProcess::execute() and QProcess::start() correctly?
Also, I do not know how to use task manager in ubuntu. can anyone point me to how I can manage the Qt Application when it hangs? It does not force quit at all.
Bookmarks