Style QProgressBar when the value is 16
Solved
General and Desktop
-
It is possible to style the
QProgressBar
using onlyQSS
when the value is16
for example?If I set 16 in value
ui->progresso->setValue(16);
Use a QSS like this:
QProgressBar { //Default QSS ... } QProgressBar:value(16) { background-color: #fc0; }
-
You can set the stylesheet in the cpp code when the condition is met, so this is possible
Example:
if (condition) { ui->pushButton_expand->setStyleSheet("QPushButton#pushButton_expand{image: url(:/image/icon/exp1);border-radius: 1px;}"); } else { //revert to default stylesheet }
-
Hi,
You can use visualRect to check whether the item is visible.
Hope it helps
-
Thanks :)
QSS don't support this? :(