Hello.
I have this label that, under certain programmable circumstances has set the lineWidth attribute 0, 1 or 2 and... depending on that attribute, a CSS gives it a certain background image.
CSS: ( using color instead of image for example purpouse )
QLabel#resultImage[lineWidth="0"] { background-image: green;
}
QLabel#resultImage[lineWidth="1"] { background-color: orange;
}
QLabel#resultImage[lineWidth="2"] { background-color: red;
}
QLabel#resultImage[lineWidth="0"] {
background-image: green;
}
QLabel#resultImage[lineWidth="1"] {
background-color: orange;
}
QLabel#resultImage[lineWidth="2"] {
background-color: red;
}
To copy to clipboard, switch view to plain text mode
This doesn't work... the label having the orange background color ALL the time.
I`ve read the documentation that says
Warning: If the value of the Qt property changes after the style sheet has been set, it might be necessary to force a style sheet recomputation. One way to achieve this is to unset the style sheet and set it again.
As the attribute changes depending on some conditions ( once a program-s lifetime) I consider heeding this warning and reloading the stylesheet like so:
qApp->setStyleSheet( qApp->styleSheet() );
qApp->setStyleSheet( qApp->styleSheet() );
To copy to clipboard, switch view to plain text mode
According to the documentation this should help but it doesn't.
Any other ideas or info?
Bookmarks