Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
We use different colors for our QGraphicsView depending on the dark or light mode. However, if you change the modes while the program is running, it is currently difficult to react to this. The only possibility I see so far is to inherit from QGraphicsView and overwrite event() to react to QEvent::PaletteChange and then:
- either iterate over all children, cast via multiple inheritance (if you inherit not only from QGraphicsItem but also from classes already derived from it) and a dynamic_cast a custom base class and call it
- or pass a helper class that triggers an event to which all items can react
Since I don't like either of these: It would be practical if there were a paletteChangeEvent(QPaletteEvent*) that is triggered when the palette of the widget/scene to which the item is currently registered changes.