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

QLabel does not size properly for a movie with @2x image loaded

    XMLWordPrintable

Details

    Description

      I loaded my file called "whatever@2x.gif" into QMovie, then set this as the movie on a QLabel.

      The movie is displayed correctly respecting the devicePixelRatio == 2.0, but the QLabel is twice as big as it needs to be. There's empty space around the actual animation.

      If I check my movie.currentPixmap().devicePixelRatio() it is correct.

      I see in qlabel.cpp that QLabelPrivate::sizeForWidth() does not use the devicePixelRatio of the movie frames as it does for a pixmap set directly on the label.

      Workaround: set the label to have a fixed size of movie.currentPixmap().size() / movie.currentPixmap().devicePixelRatio().

      Attachments

        Issue Links

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

          Activity

            People

              dvratil Daniel Vrátil
              hmoffatt Hamish Moffatt
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes