0

I want to show busy indicator using qprogressbar in my widget. I know about setting Minumum and Maximum to zero, but it makes small colored area moving from left to right and back. But I want just from left to right.

Setting min and max to zero works fine for me in QProgressDiaolog, but I don't need separate window. What should I do?

  • Please [edit] your question to show [what you have tried so far](http://whathaveyoutried.com). You should include a [mcve] of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight Jan 11 '17 at 09:47

1 Answers1

0

You simply need to add the QProgressBar widget to your form in Qt Designer: QProgressBar

enter image description here

Or add the QProgressBar object manually in the code. Then you need to set its minimum and maximum, and connect (if necessary) a signal to the QProgressBar's slot setValue(int):

ui->progressBar->setRange(0, 100);

connect(&my_obj, &MyClass::signalValue, ui->progressBar, &QProgressBar::setValue);

// or call directly the slot when it is needed:
ui->progressBar->setValue(10);
Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
  • 2
    After a re-reading of the question (and creation of a MCVE), I think that what's being asked is how to make the indeterminate progress indicator sweep repeatedly rightwards, rather than alternating rightwards and leftwards. Of course, that completely depends on the style (and possibly on the platform); I don't see the same indeterminate progress indicator as described, for example. – Toby Speight Jan 11 '17 at 10:18
  • @TobySpeight Yes! I set my app to plastique style and forgot about that. Thank you! – Всеволод Авдеев Jan 11 '17 at 13:34