Add support for cleanup functions for data-constructed QImages
authorSimon Hausmann <simon.hausmann@nokia.com>
Tue, 31 Jan 2012 12:32:22 +0000 (13:32 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 31 Jan 2012 15:21:17 +0000 (16:21 +0100)
commit298330bd436ca9437aa8023363f916b12811c7bf
treebbcfc14412984c75a183eca9ddc4244bbcc55edb
parent2bf186a2e598a4bccdc4979085e8e4d963a3819d
Add support for cleanup functions for data-constructed QImages

A QImage can be constructed with a provided buffer, that has to be
kept alive for the live-time of the QImage and all its copies.
Frameworks like CoreGraphics or Cairo offer a similar method of
creating image objects and also offer the ability to provide a callback
function that is called when the image is destroyed.

This patch adds this functionality to QImage by extending the
QImage constructors that take a raw image buffer pointer.

Change-Id: Ia6342408c560ef49b498c9e4664b4602febb0fcd
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
src/gui/image/qimage.cpp
src/gui/image/qimage.h
src/gui/image/qimage_p.h
tests/auto/gui/image/qimage/tst_qimage.cpp