Hello, i hava a problem with QProcess.
I made this connection:
connect ( myProcess ,
SIGNAL ( finished
( int ,
QProcess::ExitStatus ) ) ,
this ,
SLOT ( processVNCFinished
( int ,
QProcess::ExitStatus ) ) );
connect ( myProcess , SIGNAL ( finished ( int , QProcess::ExitStatus ) ) , this , SLOT ( processVNCFinished ( int , QProcess::ExitStatus ) ) );
To copy to clipboard, switch view to plain text mode
so when the process finish i call the slot processVNCFinished.
This is my processVNCFinished slot:
void mainWindow
::processVNCFinished ( int exitCode ,
QProcess::ExitStatus exitStatus
) {
if ( exitStatus
== QProcess::CrashExit ) {
qDebug () << "VNC client program crashed\n";
}
else if ( exitCode != 0 )
{
qDebug () << "VNC client program failed\n";
}
else
{
qDebug () << "VNC client program OK!\n";
}
}
void mainWindow::processVNCFinished ( int exitCode , QProcess::ExitStatus exitStatus )
{
if ( exitStatus == QProcess::CrashExit )
{
qDebug () << "VNC client program crashed\n";
}
else if ( exitCode != 0 )
{
qDebug () << "VNC client program failed\n";
}
else
{
qDebug () << "VNC client program OK!\n";
}
}
To copy to clipboard, switch view to plain text mode
i'm going to call vncviewer and when i close the vncviewer window clicking on the "X" on the right top window i get an exitCode = 1. Shouldn't i receive a 0 like exitCode?
In this way i always fall into qDebug () << "VNC client program failed\n" and instead i'd like to go into qDebug () << "VNC client program OK!\n".
Thx
Bookmarks