Search code examples
c++qt4qprogressbar

Qt QProgressBar - aligning text


Has anyone any suggestions on how to align the status text on the QProgressBar in Qt? By default in Windows it appears to the right of the bar but I'd prefer to place it either above the bar or within the bar itself without having to extend the object and implement a status label myself.

Screenshot below:

enter image description here


Solution

  • Yet another approach would be to set the alignment of the status text through QProgressBar::setAlignment:

    barProgress_->setAlignment(Qt::AlignCenter);
    

    Progress bar screen shot