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

Improve QImage interoperability

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • None
    • 4.8.0
    • GUI: Painting
    • None

    Description

      Add QImage constructors that take ownership of the provided buffer and deallocate it automatically

      QImage(uchar *data, int width, int height, int bytesPerLine, Format format, void (*dtor)(void *data), void *dtorArg = 0)
      QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, void (*dtor)(void *data), void *dtorArg = 0)

      ~QImageData() will call dtor(dtorArg) when dtorArg != 0 and dtor(data) otherwise.

      This will allow to "convert" externally created image objects (from other toolkits and libraries) to QImage without the need to do memcpy and without the need to manually track external object's lifetime.

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            nnemkin Nikita Nemkin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes