refs #452, added streaming operator for pixmap

This commit is contained in:
Klaus Basan
2015-09-23 02:47:27 +02:00
committed by Mathew Sutcliffe
parent 874f29098b
commit abd1927eb9
2 changed files with 38 additions and 0 deletions

28
src/blackmisc/dbus.cpp Normal file
View File

@@ -0,0 +1,28 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "blackmisc/dbus.h"
#include "blackmisc/blackmiscfreefunctions.h"
const QDBusArgument &operator>>(const QDBusArgument &argument, QPixmap &pixmap)
{
QByteArray ba;
argument >> ba;
BlackMisc::pngByteArrayToPixmapRef(ba, pixmap);
return argument;
}
QDBusArgument &operator<<(QDBusArgument &argument, const QPixmap &pixmap)
{
QByteArray ba;
BlackMisc::pixmapToPngByteArray(pixmap, ba);
argument << ba;
return argument;
}