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

Why do we need QStyle::drawItemPixmap() when working with QIcon?

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Widgets: Styles
    • None
    • All

      QStyle::drawItemPixmap() basically does the same as QIcon::paint() except that it does not need to retrieve a QPixmap from the QIcon first.
      Currently there is a mix of both versions in the styles available but I suggest to replace QStyle::drawItemPixmap() with QIcon::paint() as this avoids e.g. the knowledge about the current dpr, also QStyle::drawItemPixmap() refers to QGuiApplication::layoutDirection() whereas QIcon::paint() is using the layout direction from the paint device which may differ.

        For Gerrit Dashboard: QTBUG-131493
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            chehrlic Christian Ehrlicher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes