Hello,
I have a push button and a label in a dialog. When the push button is clicked, the program will start to do some calculation. The label is designed to display the status, such as initialization, in progress and completes, but the label is NOT updated immediately after it reaches settext(), I even tried to call repaint(), but still no luck. In the dialog, the label is always blank until coming to the end, then "Completes" is displayed.
Can anyone help point out where is wrong and how to fix this? Thanks.
Here is the code:
void Test::on_start_Button_clicked()
{
ui->label_status->setText("Reading data from file ...");
ui->label_status->repaint();
Do_1(); // function to do something
ui->label_status->setText("Action in progress ...");
ui->label_status->repaint();
Do_2(); // function to do something
ui->label_status->setText("Completes.");
ui->label_status->repaint();
void Test::on_start_Button_clicked()
{
ui->label_status->setText("Reading data from file ...");
ui->label_status->repaint();
Do_1(); // function to do something
ui->label_status->setText("Action in progress ...");
ui->label_status->repaint();
Do_2(); // function to do something
ui->label_status->setText("Completes.");
ui->label_status->repaint();
To copy to clipboard, switch view to plain text mode
Bookmarks