codeslicer
5th March 2008, 00:19
Alright, I have an application in which I use style sheets. Now I have a problem. In my application, I use this:
* {
background-color: black;
}
which sets the background color of all widgets black. Unfortunately though, the menu that appears by right-clicking on an object such as QLineEdit is also black. I do not want this behavior. I know that I can use:
QMenu {
background-color: somedifferentcolor;
}
but that wouldn't be really platform/theme independent, as I want the default style for the menu to remain intact. In CCS3, there is the not() selector, which should be used like this:
*:not(QMenu) {
background-color: black;
}
but Qt doesn't support this. Is there any way in which I can restore the QMenu's default colors or just omit it in the unary selector using Qt Style Sheets?
Thanks!
* {
background-color: black;
}
which sets the background color of all widgets black. Unfortunately though, the menu that appears by right-clicking on an object such as QLineEdit is also black. I do not want this behavior. I know that I can use:
QMenu {
background-color: somedifferentcolor;
}
but that wouldn't be really platform/theme independent, as I want the default style for the menu to remain intact. In CCS3, there is the not() selector, which should be used like this:
*:not(QMenu) {
background-color: black;
}
but Qt doesn't support this. Is there any way in which I can restore the QMenu's default colors or just omit it in the unary selector using Qt Style Sheets?
Thanks!