QtWidgets ColorRole
-
What do these five ColorRoles do?
https://doc.qt.io/qtforpython-6/PySide6/QtGui/QPalette.html#PySide6.QtGui.QPalette.ColorRole
There are some color roles used mostly for 3D bevel and shadow effects.
QPalette.Light
QPalette.Midlight
QPalette.Dark
QPalette.Mid
QPalette.ShadowDo these five ColorRoles effect the color of anything in QtWidgets?
Motif scroll bars depend on
Midto be slightly different fromWindow.What are “Motif scroll bars”?
-
What do these five ColorRoles do?
https://doc.qt.io/qtforpython-6/PySide6/QtGui/QPalette.html#PySide6.QtGui.QPalette.ColorRole
There are some color roles used mostly for 3D bevel and shadow effects.
QPalette.Light
QPalette.Midlight
QPalette.Dark
QPalette.Mid
QPalette.ShadowDo these five ColorRoles effect the color of anything in QtWidgets?
Motif scroll bars depend on
Midto be slightly different fromWindow.What are “Motif scroll bars”?
@James-Brock said in QtWidgets ColorRole:
What do these five ColorRoles do?
I can't hold back from quoting Rambo here:
Rambo said in Rambo III:
- "It's a blue light.”
- „What does it do?”
- „It turns blue.":D
@James-Brock said in QtWidgets ColorRole:
Do these five ColorRoles effect the color of anything in QtWidgets?
These are just the roles. The actual color may differ from palette setting to palette setting :)
@James-Brock said in QtWidgets ColorRole:
What are “Motif scroll bars”?
-
@James-Brock said in QtWidgets ColorRole:
What do these five ColorRoles do?
I can't hold back from quoting Rambo here:
Rambo said in Rambo III:
- "It's a blue light.”
- „What does it do?”
- „It turns blue.":D
@James-Brock said in QtWidgets ColorRole:
Do these five ColorRoles effect the color of anything in QtWidgets?
These are just the roles. The actual color may differ from palette setting to palette setting :)
@James-Brock said in QtWidgets ColorRole:
What are “Motif scroll bars”?
@Pl45m4 So the answer is no, these five ColorRoles do not effect the color of anything in QtWidgets.
-
@Pl45m4 So the answer is no, these five ColorRoles do not effect the color of anything in QtWidgets.
Anything "default" you see is painted according to its role and the palette used, which is part of the application "style".
If you change the role on some widget element, it probably would receive a different color.
However the style/palette defines the actual color and what is painted, not the role.This is how themes work. Everything has its own role in order to still look good with any style and to avoid black on black or white on white. The roles assigned to native elements ensure that.
If you switch to a dark theme, like shown here
the palette changes and it still looks good.
-
Anything "default" you see is painted according to its role and the palette used, which is part of the application "style".
If you change the role on some widget element, it probably would receive a different color.
However the style/palette defines the actual color and what is painted, not the role.This is how themes work. Everything has its own role in order to still look good with any style and to avoid black on black or white on white. The roles assigned to native elements ensure that.
If you switch to a dark theme, like shown here
the palette changes and it still looks good.
@Pl45m4 Specifically are there any examples of Qt widgets which get their color from these five roles? (I'm not asking “how themes work.”)
-
@Pl45m4 Specifically are there any examples of Qt widgets which get their color from these five roles? (I'm not asking “how themes work.”)
Every widget is styled using the app style / palette.
For specific widgets check the source yourself what elements are used and what roles are assigned to it.