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

Unnecessary detach in QImage::setAlphaChannel(const QImage &alphaChannel)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.6.2
    • None
    • ce0af99f47c1728a6d8145ea89f41b1c9207104a

    Description

      While fixing QTBUG-4887, I noticed what appears to be an unnecessary call to detach() in QImage::setAlphaChannel. It happens just before an assignment to *this with only a call to convertToFormat in between. I think the call to convertToFormat has no effect on this, and the assignment to *this will itself deref any shared copy, so the detach call could just create an unnecessary copy of the existing image, which would take quite a long time.

      Attachments

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

        Activity

          People

            rodal Samuel Rødal
            mread Murray Read
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes