PDA

View Full Version : How to wait till GUI contollers are changed?



IndikaU
13th October 2011, 07:25
Hi,

I want to disable some controllers on a button click and start a process after that. I put the controller settings in beginning of the slot.
Here's the code.


//OnClick event

btnStart->setEnabled(false); //Need this to disabled before process starts below
btnBrowse->setEnabled(false); //Need this to disabled before process starts below

proc = new QProcess(this);
.
.
.
//..... this will wait till the process is finished

How can I achieve this?

Thanks,
Indika...

Jonny174
13th October 2011, 08:45
connect( proc, SIGNAL(finished(int)), this, SLOT(procFinished(int)) );
...
int procFinished( int status )
{
btnStart->setEnabled( true );
btnBrowse->setEnabled( true );
}

IndikaU
13th October 2011, 10:05
Hi Jonny,

I wanted to do is disabling the controllers before process starting. Can not disable them before the button click since the user has to set values from there. The code u have posted wait until the process end to enable controllers.

Anyway thanks for the reply.

Indika...