0

I'm using progress bar in my app. when i navigating first widget to second widget and in-between i'm using progress bar in another widget.

 //code:
    progressform *pgm = new progressform(); // calling progress bar widget
    pgm->adjustSize();
    pgm->show();
    for(int i=24;i<=100;i++) //initial setvalue is 24
    {
        pgm->ui->progressBar->setValue(i);
     }
    detailWidget *dwt = new  detailWidget(); // calling detail widget

    dwt->show();

Before going to detailwidget i called progressform(widget) and after that the progressbar setvalue reach 100 it moves to detailwidget. the problem is i cant resize the progress widget in to center of the screen like popup screen and I want to sleep time because i want to see the progress value increased one by one?

Thanks in advance

selladurai
  • 6,491
  • 14
  • 56
  • 88

2 Answers2

3

I can recommend using QProgressDialog instead which pops up centered automatically.

Exa
  • 4,020
  • 7
  • 43
  • 60
2

You'll have to center your progress bar manually. Popup screens do so automatically, but progress bars normally are used as part of a dialog. Therefore they are positioned by the dialog layout.

As for the sleeping, that's probably a design error. If your task is so fast you'd need a sleep just to see the progress bar, you shouldn't have a progress bar in the first place.

MSalters
  • 173,980
  • 10
  • 155
  • 350