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

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

XMLWordPrintable

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

      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;

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes