I have a GUI Button that calls a shell script to start recording a video. In addition I want a slider to show progress of recording (maximum recording time is 30 seconds). I build the following function:
coid MainWindow::on_recordStart_clicked()
{
QElapsedTimer timer;
QProcess *Prozess = new QProcess();
Prozess->start("record.sh");
timer.start();
for(;;)
{
ui->timelineLabel->setText(QString::number(timer.elapsed())); //label
ui->timeLine->setValue(timer.elapsed()); //slider
if (timer.hasExpired(30000)) break;
}
It only updates the Slider and Label after the break. Anyone knows why?