summaryrefslogtreecommitdiffstats
path: root/src/render/texture
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@theqtcompany.com>2015-12-08 11:50:37 +0200
committerTomi Korpipää <tomi.korpipaa@theqtcompany.com>2015-12-09 05:18:19 +0000
commit0e15154c9f0d982096a551efc53fd363d2b2f68d (patch)
tree4917ca73c44a92297db7cc3dbd72d2716481ccc7 /src/render/texture
parent036ea9fcfdd343c805e1a900528e7a2367d6c373 (diff)
Added parameters to signals and made setters Q_SLOTS
Change-Id: Icec2f9f207221e35ffdeeb594bb9b4dc6ef890f1 Task-number: QTBUG-49797 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/texture')
-rw-r--r--src/render/texture/qabstracttextureimage.cpp6
-rw-r--r--src/render/texture/qabstracttextureimage.h13
-rw-r--r--src/render/texture/qabstracttextureprovider.cpp26
-rw-r--r--src/render/texture/qabstracttextureprovider.h69
-rw-r--r--src/render/texture/qtextureimage.cpp2
-rw-r--r--src/render/texture/qtextureimage.h6
-rw-r--r--src/render/texture/qwrapmode.cpp6
-rw-r--r--src/render/texture/qwrapmode.h14
8 files changed, 69 insertions, 73 deletions
diff --git a/src/render/texture/qabstracttextureimage.cpp b/src/render/texture/qabstracttextureimage.cpp
index ef3414e62..38e5ad267 100644
--- a/src/render/texture/qabstracttextureimage.cpp
+++ b/src/render/texture/qabstracttextureimage.cpp
@@ -166,7 +166,7 @@ void QAbstractTextureImage::setMipmapLevel(int level)
Q_D(QAbstractTextureImage);
if (level != d->m_mipmapLevel) {
d->m_mipmapLevel = level;
- emit mipmapLevelChanged();
+ emit mipmapLevelChanged(level);
}
}
@@ -175,7 +175,7 @@ void QAbstractTextureImage::setLayer(int layer)
Q_D(QAbstractTextureImage);
if (layer != d->m_layer) {
d->m_layer = layer;
- emit layerChanged();
+ emit layerChanged(layer);
}
}
@@ -184,7 +184,7 @@ void QAbstractTextureImage::setCubeMapFace(QAbstractTextureProvider::CubeMapFace
Q_D(QAbstractTextureImage);
if (face != d->m_face) {
d->m_face = face;
- emit cubeMapFaceChanged();
+ emit cubeMapFaceChanged(face);
}
}
diff --git a/src/render/texture/qabstracttextureimage.h b/src/render/texture/qabstracttextureimage.h
index dee69c3a2..1a6ffc6de 100644
--- a/src/render/texture/qabstracttextureimage.h
+++ b/src/render/texture/qabstracttextureimage.h
@@ -74,17 +74,18 @@ public:
int layer() const;
QAbstractTextureProvider::CubeMapFace cubeMapFace() const;
+ void update();
+ virtual QTextureDataFunctorPtr dataFunctor() const = 0;
+
+public Q_SLOTS:
void setMipmapLevel(int level);
void setLayer(int layer);
void setCubeMapFace(QAbstractTextureProvider::CubeMapFace face);
- void update();
- virtual QTextureDataFunctorPtr dataFunctor() const = 0;
-
Q_SIGNALS:
- void mipmapLevelChanged();
- void layerChanged();
- void cubeMapFaceChanged();
+ void mipmapLevelChanged(int mipmapLevel);
+ void layerChanged(int layer);
+ void cubeMapFaceChanged(QAbstractTextureProvider::CubeMapFace cubeMapFace);
protected:
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/texture/qabstracttextureprovider.cpp b/src/render/texture/qabstracttextureprovider.cpp
index 2f91fd385..ca9849771 100644
--- a/src/render/texture/qabstracttextureprovider.cpp
+++ b/src/render/texture/qabstracttextureprovider.cpp
@@ -147,7 +147,7 @@ void QAbstractTextureProvider::setWidth(int width)
Q_D(QAbstractTextureProvider);
if (d->m_width != width) {
d->m_width = width;
- emit widthChanged();
+ emit widthChanged(width);
}
}
@@ -161,7 +161,7 @@ void QAbstractTextureProvider::setHeight(int height)
Q_D(QAbstractTextureProvider);
if (d->m_height != height) {
d->m_height = height;
- emit heightChanged();
+ emit heightChanged(height);
}
}
@@ -175,7 +175,7 @@ void QAbstractTextureProvider::setDepth(int depth)
Q_D(QAbstractTextureProvider);
if (d->m_depth != depth) {
d->m_depth = depth;
- emit depthChanged();
+ emit depthChanged(depth);
}
}
@@ -211,7 +211,7 @@ void QAbstractTextureProvider::setMaximumLayers(int maximumLayers)
Q_D(QAbstractTextureProvider);
if (d->m_maximumLayers != maximumLayers) {
d->m_maximumLayers = maximumLayers;
- emit maximumLayersChanged();
+ emit maximumLayersChanged(maximumLayers);
}
}
@@ -245,7 +245,7 @@ void QAbstractTextureProvider::setUnique(bool unique)
Q_D(QAbstractTextureProvider);
if (d->m_unique != unique) {
d->m_unique = unique;
- emit uniqueChanged();
+ emit uniqueChanged(unique);
}
}
@@ -270,7 +270,7 @@ void QAbstractTextureProvider::setFormat(TextureFormat format)
Q_D(QAbstractTextureProvider);
if (d->m_format != format) {
d->m_format = format;
- emit formatChanged();
+ emit formatChanged(format);
}
}
@@ -293,7 +293,7 @@ void QAbstractTextureProvider::setStatus(Status status)
Q_D(QAbstractTextureProvider);
if (status != d->m_status) {
d->m_status = status;
- emit statusChanged();
+ emit statusChanged(status);
}
}
@@ -382,7 +382,7 @@ void QAbstractTextureProvider::setGenerateMipMaps(bool gen)
Q_D(QAbstractTextureProvider);
if (d->m_autoMipMap != gen) {
d->m_autoMipMap = gen;
- emit generateMipMapsChanged();
+ emit generateMipMapsChanged(gen);
}
}
@@ -402,7 +402,7 @@ void QAbstractTextureProvider::setMinificationFilter(Filter f)
Q_D(QAbstractTextureProvider);
if (d->m_minFilter != f) {
d->m_minFilter = f;
- emit minificationFilterChanged();
+ emit minificationFilterChanged(f);
}
}
@@ -416,7 +416,7 @@ void QAbstractTextureProvider::setMagnificationFilter(Filter f)
Q_D(QAbstractTextureProvider);
if (d->m_magFilter != f) {
d->m_magFilter = f;
- emit magnificationFilterChanged();
+ emit magnificationFilterChanged(f);
}
}
@@ -479,7 +479,7 @@ void QAbstractTextureProvider::setMaximumAnisotropy(float anisotropy)
Q_D(QAbstractTextureProvider);
if (!qFuzzyCompare(d->m_maximumAnisotropy, anisotropy)) {
d->m_maximumAnisotropy = anisotropy;
- emit maximumAnisotropyChanged();
+ emit maximumAnisotropyChanged(anisotropy);
}
}
@@ -499,7 +499,7 @@ void QAbstractTextureProvider::setComparisonFunction(QAbstractTextureProvider::C
Q_D(QAbstractTextureProvider);
if (d->m_comparisonFunction != function) {
d->m_comparisonFunction = function;
- emit comparisonFunctionChanged();
+ emit comparisonFunctionChanged(function);
}
}
@@ -519,7 +519,7 @@ void QAbstractTextureProvider::setComparisonMode(QAbstractTextureProvider::Compa
Q_D(QAbstractTextureProvider);
if (d->m_comparisonMode != mode) {
d->m_comparisonMode = mode;
- emit comparisonModeChanged();
+ emit comparisonModeChanged(mode);
}
}
diff --git a/src/render/texture/qabstracttextureprovider.h b/src/render/texture/qabstracttextureprovider.h
index 1e9aa08c8..bd13b59ea 100644
--- a/src/render/texture/qabstracttextureprovider.h
+++ b/src/render/texture/qabstracttextureprovider.h
@@ -263,8 +263,8 @@ public:
Target target() const;
- void setFormat(TextureFormat format);
TextureFormat format() const;
+ bool generateMipMaps() const;
Status status() const;
@@ -272,58 +272,51 @@ public:
void removeTextureImage(QAbstractTextureImage *textureImage);
QList<QAbstractTextureImage *> textureImages() const;
- void setGenerateMipMaps(bool gen);
- bool generateMipMaps() const;
-
// sampler data - in the future proxy to a Sampler helper
- void setMinificationFilter(Filter f);
- void setMagnificationFilter(Filter f);
-
- Filter minificationFilter() const;
- Filter magnificationFilter() const;
-
void setWrapMode(const QTextureWrapMode &wrapMode);
QTextureWrapMode *wrapMode();
- void setMaximumAnisotropy(float anisotropy);
- float maximumAnisotropy() const;
+ void setSize(int width, int height=1, int depth=1);
- void setComparisonFunction(ComparisonFunction function);
+ Filter minificationFilter() const;
+ Filter magnificationFilter() const;
+ float maximumAnisotropy() const;
ComparisonFunction comparisonFunction() const;
-
- void setComparisonMode(ComparisonMode mode);
ComparisonMode comparisonMode() const;
-
- void setSize(int width, int height=1, int depth=1);
-
- void setWidth(int width);
- void setHeight(int height);
- void setDepth(int depth);
-
int width() const;
int height() const;
int depth() const;
-
- void setMaximumLayers(int maximumLayers);
int maximumLayers() const;
+ bool isUnique() const;
+public Q_SLOTS:
+ void setFormat(TextureFormat format);
+ void setGenerateMipMaps(bool gen);
+ void setWidth(int width);
+ void setHeight(int height);
+ void setDepth(int depth);
+ void setMinificationFilter(Filter f);
+ void setMagnificationFilter(Filter f);
+ void setMaximumAnisotropy(float anisotropy);
+ void setComparisonFunction(ComparisonFunction function);
+ void setComparisonMode(ComparisonMode mode);
+ void setMaximumLayers(int maximumLayers);
void setUnique(bool unique);
- bool isUnique() const;
Q_SIGNALS:
- void formatChanged();
- void statusChanged();
- void generateMipMapsChanged();
- void widthChanged();
- void heightChanged();
- void depthChanged();
- void magnificationFilterChanged();
- void minificationFilterChanged();
- void maximumAnisotropyChanged();
- void comparisonFunctionChanged();
- void comparisonModeChanged();
- void maximumLayersChanged();
- void uniqueChanged();
+ void formatChanged(TextureFormat format);
+ void statusChanged(Status status);
+ void generateMipMapsChanged(bool generateMipMaps);
+ void widthChanged(int width);
+ void heightChanged(int height);
+ void depthChanged(int depth);
+ void magnificationFilterChanged(Filter magnificationFilter);
+ void minificationFilterChanged(Filter minificationFilter);
+ void maximumAnisotropyChanged(float maximumAnisotropy);
+ void comparisonFunctionChanged(ComparisonFunction comparisonFunction);
+ void comparisonModeChanged(ComparisonMode comparisonMode);
+ void maximumLayersChanged(int maximumLayers);
+ void uniqueChanged(bool unique);
protected:
explicit QAbstractTextureProvider(Qt3DCore::QNode *parent = 0);
diff --git a/src/render/texture/qtextureimage.cpp b/src/render/texture/qtextureimage.cpp
index 761d26ae5..2fdf16469 100644
--- a/src/render/texture/qtextureimage.cpp
+++ b/src/render/texture/qtextureimage.cpp
@@ -165,7 +165,7 @@ void QTextureImage::setSource(const QUrl &source)
Q_D(QTextureImage);
if (source != d->m_source) {
d->m_source = source;
- emit sourceChanged();
+ emit sourceChanged(source);
update();
}
}
diff --git a/src/render/texture/qtextureimage.h b/src/render/texture/qtextureimage.h
index 357cc9ebf..c3528a245 100644
--- a/src/render/texture/qtextureimage.h
+++ b/src/render/texture/qtextureimage.h
@@ -56,12 +56,14 @@ public:
~QTextureImage();
QUrl source() const;
- void setSource(const QUrl &source);
QTextureDataFunctorPtr dataFunctor() const Q_DECL_OVERRIDE;
+public Q_SLOTS:
+ void setSource(const QUrl &source);
+
Q_SIGNALS:
- void sourceChanged();
+ void sourceChanged(const QUrl &source);
protected:
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/texture/qwrapmode.cpp b/src/render/texture/qwrapmode.cpp
index 4baa6711b..abbd63261 100644
--- a/src/render/texture/qwrapmode.cpp
+++ b/src/render/texture/qwrapmode.cpp
@@ -95,7 +95,7 @@ void QTextureWrapMode::setX(WrapMode x)
Q_D(QTextureWrapMode);
if (d->m_x != x) {
d->m_x = x;
- emit xChanged();
+ emit xChanged(x);
}
}
@@ -117,7 +117,7 @@ void QTextureWrapMode::setY(WrapMode y)
Q_D(QTextureWrapMode);
if (d->m_y != y) {
d->m_y = y;
- emit yChanged();
+ emit yChanged(y);
}
}
@@ -139,7 +139,7 @@ void QTextureWrapMode::setZ(WrapMode z)
Q_D(QTextureWrapMode);
if (d->m_z != z) {
d->m_z = z;
- emit zChanged();
+ emit zChanged(z);
}
}
diff --git a/src/render/texture/qwrapmode.h b/src/render/texture/qwrapmode.h
index 4bd2cc1ff..40e6d5583 100644
--- a/src/render/texture/qwrapmode.h
+++ b/src/render/texture/qwrapmode.h
@@ -65,19 +65,19 @@ public:
explicit QTextureWrapMode(WrapMode wrapMode = ClampToEdge, QObject *parent = 0);
explicit QTextureWrapMode(WrapMode x, WrapMode y, WrapMode z, QObject *parent = 0);
- void setX(WrapMode x);
WrapMode x() const;
-
- void setY(WrapMode y);
WrapMode y() const;
+ WrapMode z() const;
+public Q_SLOTS:
+ void setX(WrapMode x);
+ void setY(WrapMode y);
void setZ(WrapMode z);
- WrapMode z() const;
Q_SIGNALS:
- void xChanged();
- void yChanged();
- void zChanged();
+ void xChanged(WrapMode x);
+ void yChanged(WrapMode y);
+ void zChanged(WrapMode z);
private:
Q_DECLARE_PRIVATE(QTextureWrapMode)