Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131097

Add palette change event to QGraphicsItem

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Widgets: GraphicsView
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bibr Andreas Aardal Hanssen
            EliteScience Heiko Thiel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes