Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
QProgressBar我想知道是否有任何简单的方法可以以秒的HH:mm:ss格式显示当前值和最大值。目前我的格式是%v/%m,有没有办法将其显示为时间?
QProgressBar
HH:mm:ss
%v/%m
您可以使用QProgressBar::setFormat(QString); 您可以使用任何您想要的文本,只需将您的时间转换为 QString。
QProgressBar::setFormat(QString)
http://doc.qt.io/qt-5/qprogressbar.html#format-prop