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

QImage::scaled() returns a hard copy when new size equals old size.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.6.2
    • 4.6.0
    • Image formats
    • None
    • fdf827381a5e27c1c4ff6e075196befe88440fb2

    Description

      One would assume that Qt uses implicit sharing so that in the following example:

      QImage image(100,100,QImage::Format_RGB32);
      image = image.scaled(100,100);

      the second line should be a no-op.

      This is easily fixed in QImage::scaled(), where

      if (newSize == size())
      return copy();

      should be

      if (newSize == size())
      return*this;

      Attachments

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

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            bjornpiltz Björn Piltz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes