From beb3dfed07b35d74050fcd40a99f705c033597f7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 4 Aug 2011 13:01:04 +0300 Subject: Support QImage and others in Wayland clipboard. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jørgen Lind --- src/plugins/platforms/wayland/wayland.pro | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/wayland/wayland.pro') diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro index 857a2918ce..1e0bbe6cdd 100644 --- a/src/plugins/platforms/wayland/wayland.pro +++ b/src/plugins/platforms/wayland/wayland.pro @@ -20,7 +20,8 @@ SOURCES = main.cpp \ qwaylandwindow.cpp \ qwaylandscreen.cpp \ qwaylandshmwindow.cpp \ - qwaylandclipboard.cpp + qwaylandclipboard.cpp \ + qwaylandmime.cpp HEADERS = qwaylandintegration.h \ qwaylandnativeinterface.h \ @@ -31,7 +32,8 @@ HEADERS = qwaylandintegration.h \ qwaylandshmsurface.h \ qwaylandbuffer.h \ qwaylandshmwindow.h \ - qwaylandclipboard.h + qwaylandclipboard.h \ + qwaylandmime.h INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND LIBS += $$QMAKE_LIBS_WAYLAND -- cgit v1.2.3