Questions about StyleSheet.
-
Hello there, I got some questions about qss:
(1) How to place the text of QProgressBar outside the bar when styleSheet is set to the QProgressBar?
By default, the text of the QProgressBar is always outside the bar:
However, when I set a styleSheet to the progressbar, I found that the text can be only put inside the bar:
My stylesheet is like this:
QProgressBar* b = new QProgressBar(); QString s1 = "QProgressBar{border: 1px solid #FFFFFF; border-radius: 8px; background-color: #ECECEC; color:#00ADEF; font: bold 18px; text-align: right;}\n"; QString s2 = "QProgressBar::chunk {background-color: #00ADEF; border-radius: 7px;}\n"; b->setStyleSheet(s1.append(s2));What shuold I do if I want the effects of the styleSheet and keep the text outside the bar?
(2) Dynamically changing the icons and the size of the icons of the QPushButton through StyleSheet when hovering and not hovering.
I have tried qproperty-iconSize along with qproperty-icon , but this method can only get the icon size to be what I wanted, but the icon couldn't change.
I also tried icon and icon-size for "hover" and "!hover" conditions, and the icon could change as I wanted, but the icon-size seemed not to work. Could anyone gives me any hints?