aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickimagebase_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-12-09 13:44:31 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-31 11:04:06 +0100
commita6e661d25bf7ebeb8f4e58925aa9375f5ca10ef3 (patch)
treeeff5daac853cbc4d6e75a25a71b89a19141d21e0 /src/quick/items/qquickimagebase_p.h
parent276d00cff956cb54612ec425b7c40eb50a20d78a (diff)
Image ColorSpace bindings for Quick/QML
Adds a ColorSpace type mapped to QColorSpace, and adds a property to Image nodes to read and change it, converting the image if necessary on read. Fixes: QTBUG-80616 Change-Id: Ie80c8bc045f66de01de3a5d2c4a9974f07d2871d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickimagebase_p.h')
-rw-r--r--src/quick/items/qquickimagebase_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h
index 238b31b2e5..095547a2cf 100644
--- a/src/quick/items/qquickimagebase_p.h
+++ b/src/quick/items/qquickimagebase_p.h
@@ -53,6 +53,7 @@
#include "qquickimplicitsizeitem_p.h"
#include <private/qtquickglobal_p.h>
+#include <QtGui/qcolorspace.h>
QT_BEGIN_NAMESPACE
@@ -70,6 +71,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickImageBase : public QQuickImplicitSizeItem
Q_PROPERTY(bool mirror READ mirror WRITE setMirror NOTIFY mirrorChanged)
Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY currentFrameChanged REVISION 14)
Q_PROPERTY(int frameCount READ frameCount NOTIFY frameCountChanged REVISION 14)
+ Q_PROPERTY(QColorSpace colorSpace READ colorSpace WRITE setColorSpace NOTIFY colorSpaceChanged REVISION 15)
QML_NAMED_ELEMENT(ImageBase);
QML_ADDED_IN_MINOR_VERSION(14)
@@ -122,6 +124,9 @@ public:
virtual void setAutoTransform(bool transform);
bool autoTransform() const;
+ QColorSpace colorSpace() const;
+ virtual void setColorSpace(const QColorSpace &colorSpace);
+
static void resolve2xLocalFile(const QUrl &url, qreal targetDevicePixelRatio, QUrl *sourceUrl, qreal *sourceDevicePixelRatio);
// Use a virtual rather than a signal->signal to avoid the huge
@@ -139,6 +144,7 @@ Q_SIGNALS:
Q_REVISION(14) void currentFrameChanged();
Q_REVISION(14) void frameCountChanged();
Q_REVISION(15) void sourceClipRectChanged();
+ Q_REVISION(15) void colorSpaceChanged();
protected:
void loadEmptyUrl();