Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QProgressDialog shows progress always in %



  • Hi,

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

    Thanks



  • Unfortunately QProgressDialog does not provide a property for that, in contrary to a [[Doc:QProgressBar]].



  • I think (not tried) this is easy to solve with a simple hack like this:
    @
    QProgressBar* progressBar = theProgressDialog->findChild<QProgressBar*>();
    if (progressBar) {
    progressBar->setFormat("%v/%m"); //or whatever format your fancy
    } else {
    //something wend wrong. Perhaps QProgressDialog didn't use an internal QProgressBar after all?
    }
    @


Log in to reply