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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes