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

Improve QImage interoperability

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes