10 #include <QReadLocker>
11 #include <QWriteLocker>
24 if (
this == &other) {
return *
this; }
27 auto tuple = std::make_tuple(other.m_pixmap, other.m_hasCachedPixmap, other.m_array);
31 std::tie(m_pixmap, m_hasCachedPixmap, m_array) = tuple;
38 if (this->m_hasCachedPixmap) {
return this->m_pixmap; }
42 this->m_hasCachedPixmap =
true;
43 if (this->m_array.
isEmpty()) {
return this->m_pixmap; }
44 bool s = this->m_pixmap.
loadFromData(this->m_array,
"PNG");
47 return this->m_pixmap;
53 if (this->m_hasCachedPixmap) {
return false; }
54 return (this->m_array.
isEmpty() || this->m_array.isNull());
57 CPixmap::operator
QPixmap()
const {
return pixmap(); }
67 void CPixmap::fillByteArray()
72 this->m_pixmap.
save(&buffer,
"PNG");
Pixmap which can be transferred via DBus.
bool isNull() const
With Pixmap?
const QPixmap & pixmap() const
Corresponding pixmap.
CPixmap()=default
Default constructor.
QString convertToQString(bool i18n=false) const
Cast as QString.
CPixmap & operator=(const CPixmap &other)
Copy assignment (because of mutex)
QPixmap toPixmap() const
Corresponding pixmap.
Mix of the most commonly used mixin classes.
Free functions in swift::misc.
bool isEmpty() const const
bool loadFromData(const QByteArray &data, const char *format, Qt::ImageConversionFlags flags)
bool save(QIODevice *device, const char *format, int quality) const const
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.