Re: QProgressDialog stucks
you have to process events now and then (see QCoreApplication::processEvents()) if there is no (other) event loop processing
Re: QProgressDialog stucks
thanks for your answer,
i cant get it to work, i run qApp->processEvents();/QCoreApplication->processEvents();
before and after i call the qprocess, and ive also tried to run the processevents function before and after the qprogressdialog but it wont work,
any example code? xD
Re: QProgressDialog stucks
don't use waitFor* methods where you don't have to because they are blocking - as their names say - they're just waiting and doing nothing (your whole application is just waiting) until something is done. Create progress dialog on a heap and connect QProcess::finished() with QProgressDialog::close() and don't use waitForFinished() so in between your applicantion can process events.
P.S. And I'm not sure but you can set WA_DeleteOnClose attribute to the QProgressDialog...
Re: QProgressDialog stucks
i dont want to create new slots and staff so ill use the standart system() function
code ive used but its no working:
Code:
progress.setRange(0,0);
progress.setWindowModality(Qt::WindowModal);
qApp->processEvents();
while(progress.exec())
{
system ( InstallPkgCom ); //install package
}
progress.close();
Re: QProgressDialog stucks
during the execution of system() the calling thread "pauses" - you can't show a QProgressDialog nor interact with it during that time. So use QProcess instead.
Re: QProgressDialog stucks
well ive tried to do ti with byconnecting qrocess::finished to QProgressDialog::close()
but it says:
Code:
Object
::connect: No such
signal QProcess::finished()
heres my code:
Code:
connect( installproc, SIGNAL(finished()),
this, SLOT(processFinished()) );
installproc->start(InstallPkgCom);
Re: QProgressDialog stucks
you can check in docs that it is: void finished ( int exitCode, QProcess::ExitStatus exitStatus )
Re: QProgressDialog stucks
thank you all for your help i did it!
Code:
progress->setLabelText("Removing Package...");
progress->setRange(0,0);
progress->setWindowModality(Qt::WindowModal);
removeproc->start(RemovePkgCom);
connect( removeproc,
SIGNAL(finished
(int,
QProcess::ExitStatus)),
this,
SLOT(removeProcessFinished
()));
progress->exec();
:D:D:D:D