How to set qss property back to its default value?
-
I'm stying the QProgressBar using qss:
@QProgressBar::chunk {
background-color: #FF0000;
width: 6px;
margin: 1px;
}@
this piece of code is just similar to the "qt styesheet sample page":http://doc.qt.nokia.com/4.6/stylesheet-examples.html#customizing-qprogressbarand then I have a special QProgressBar to overwrite this style define, actually, I don't need the grid effect this time, so I set the margin to 0, and when I tried to set the width back to its default value, I got stuck.
the code is something like this:
@QProgressBar#someSpecialBar::chunk {
background: url(:/bg.png);
margin:0;
width: ???;
}@
I searched around and tried the values auto/none/0/initial/default/whatever and had no lucky here, it just wont give me the right effect, when the width is not specified.
Anyone have any suggestions on this?Thanks!
-
ok not sure if I understood your question fully ...
You have set a qss to your app and then you have overridden it in your progress bar and now to reset the style of the progress bar to the default, you just need to do this ...
@
myprogressbar->setStyleSheet("");
@it will revert to the default style
-
Thanks for your reply
This is what I actually mean, just to be clear:
I get a qss file for styling the whole interface, in which I have many process bars.
But there is one of them, that I need to style in a different way, and want to do that in the same qss file.