Support QImage and others in Wayland clipboard.
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Thu, 4 Aug 2011 10:01:04 +0000 (13:01 +0300)
committerQt by Nokia <qt-info@nokia.com>
Thu, 4 Aug 2011 10:10:53 +0000 (12:10 +0200)
commitbeb3dfed07b35d74050fcd40a99f705c033597f7
treed9371ebaef8639ee12ad500cfdce3852eb92f302
parent9158f5a979fa36a944c736d64cdac2c4b6621a76
Support QImage and others in Wayland clipboard.

The wayland plugin's clipboard implementation lacked support for data
set via QMimeData::setImageData, QClipboard::setPixmap, etc. because
everything was treated as a QByteArray. A variant having an image
cannot however be converted to a byte array. Therefore, to make these
convenience functions to work, the image is now encoded via
QImageWriter before sending it. On the receiving side QMimeData is
capable of decoding images from byte arrays, so no problem there.
The patch also renames an internal QWaylandMimeData class to a more
suitable clipboard-specific name as the functionality is clipboard
specific.

Change-Id: I77e7df903b8dbe9731613fdbb9693b2a37b05d18
Reviewed-on: http://codereview.qt.nokia.com/2616
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/plugins/platforms/wayland/qwaylandclipboard.cpp
src/plugins/platforms/wayland/qwaylandclipboard.h
src/plugins/platforms/wayland/qwaylandmime.cpp [new file with mode: 0644]
src/plugins/platforms/wayland/qwaylandmime.h [new file with mode: 0644]
src/plugins/platforms/wayland/wayland.pro