December 19, 2011

ThomasJoachim ThomasJoachim
Lab Rat
15 posts

QProgressDialog shows progress always in %



I don’t like to see the progress in %. How to change this?
Up to now I didn’t find something for override.


2 replies

December 19, 2011

Volker Volker
Ant Farmer
5331 posts

Unfortunately QProgressDialog does not provide a property for that, in contrary to a QProgressBar.

December 19, 2011

Andre Andre
Robot Herder
6663 posts

I think (not tried) this is easy to solve with a simple hack like this:

  1. QProgressBar* progressBar = theProgressDialog->findChild<QProgressBar*>();
  2. if (progressBar) {
  3.   progressBar->setFormat("%v/%m"); //or whatever format your fancy
  4. } else {
  5.   //something wend wrong. Perhaps QProgressDialog didn't use an internal QProgressBar after all?
  6. }

  ‹‹ ComboBoxDelegate openPersistentEditor placement      Issues painting from my own OpenGL Widget (not QGL) on windows ››

You must log in to post a reply. Not a member yet? Register here!