Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 327
kh25 Avatar asked Feb 21 '13 17:02

kh25


2 Answers

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

barProgress_->setAlignment(Qt::AlignCenter);

Progress bar screen shot

like image 153
Andreas Fester Avatar answered Sep 21 '22 23:09

Andreas Fester


You can use stylesheets to modify the look of the progress bar. Here's an example: http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qprogressbar

like image 24
vipw Avatar answered Sep 18 '22 23:09

vipw