summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-04-02 11:38:01 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-05-13 08:13:14 +0000
commitc19ab81d5547079c8dc28824071562d256637621 (patch)
tree370c6df1df4790d8831bb5b3e3a6f8f534024d5d
parent3bef2c0ca1b7e3fee0adfaf2b53fb11d287c3d55 (diff)
Port from Q_ENUMS to new macro Q_ENUM.
Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. Change-Id: I39c61af189daebe2bf0c7474202da9f6110441c5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/core-components/qcameralens.h3
-rw-r--r--src/render/frontend/framegraph-components/qclearbuffer.h2
-rw-r--r--src/render/frontend/framegraph-components/qsortcriterion.h2
-rw-r--r--src/render/frontend/qabstractsceneloader.h2
-rw-r--r--src/render/frontend/qabstracttextureprovider.h16
-rw-r--r--src/render/frontend/qalphatest.h2
-rw-r--r--src/render/frontend/qblendequation.h2
-rw-r--r--src/render/frontend/qblendstate.h2
-rw-r--r--src/render/frontend/qcullface.h2
-rw-r--r--src/render/frontend/qdepthtest.h2
-rw-r--r--src/render/frontend/qfrontface.h2
-rw-r--r--src/render/frontend/qopenglfilter.h4
-rw-r--r--src/render/frontend/qparametermapping.h2
-rw-r--r--src/render/frontend/qrenderattachment.h4
-rw-r--r--src/render/frontend/qrenderstate.h3
-rw-r--r--src/render/frontend/qshaderdata.h2
-rw-r--r--src/render/frontend/qshaderprogram.h2
-rw-r--r--src/render/frontend/qstenciltest.h4
-rw-r--r--src/render/frontend/qwrapmode.h2
-rw-r--r--src/render/io/abstractsceneparser_p.h2
20 files changed, 30 insertions, 32 deletions
diff --git a/src/core/core-components/qcameralens.h b/src/core/core-components/qcameralens.h
index 54742ef26..0e871cc6b 100644
--- a/src/core/core-components/qcameralens.h
+++ b/src/core/core-components/qcameralens.h
@@ -53,8 +53,6 @@ class QCameraLensPrivate;
class QT3DCORESHARED_EXPORT QCameraLens : public QComponent
{
Q_OBJECT
-
- Q_ENUMS( ProjectionType )
Q_PROPERTY(ProjectionType projectionType READ projectionType WRITE setProjectionType NOTIFY projectionTypeChanged)
Q_PROPERTY(float nearPlane READ nearPlane WRITE setNearPlane NOTIFY nearPlaneChanged)
Q_PROPERTY(float farPlane READ farPlane WRITE setFarPlane NOTIFY farPlaneChanged)
@@ -74,6 +72,7 @@ public:
PerspectiveProjection,
FrustumProjection
};
+ Q_ENUM(ProjectionType)
void setProjectionType(ProjectionType projectionType);
ProjectionType projectionType() const;
diff --git a/src/render/frontend/framegraph-components/qclearbuffer.h b/src/render/frontend/framegraph-components/qclearbuffer.h
index 8e6991577..1559511d3 100644
--- a/src/render/frontend/framegraph-components/qclearbuffer.h
+++ b/src/render/frontend/framegraph-components/qclearbuffer.h
@@ -48,7 +48,6 @@ class QClearBufferPrivate;
class QT3DRENDERERSHARED_EXPORT QClearBuffer : public QFrameGraphNode
{
Q_OBJECT
- Q_ENUMS(BufferType)
Q_PROPERTY(BufferType buffers READ buffers WRITE setBuffers NOTIFY buffersChanged)
public:
explicit QClearBuffer(QNode *parent = 0);
@@ -63,6 +62,7 @@ public:
ColorDepthStencilBuffer = ColorBuffer | DepthStencilBuffer,
AllBuffers = 0xFFFFFFFF
};
+ Q_ENUM(BufferType)
void setBuffers(BufferType buffers);
BufferType buffers() const;
diff --git a/src/render/frontend/framegraph-components/qsortcriterion.h b/src/render/frontend/framegraph-components/qsortcriterion.h
index f8934c952..ef413eeb5 100644
--- a/src/render/frontend/framegraph-components/qsortcriterion.h
+++ b/src/render/frontend/framegraph-components/qsortcriterion.h
@@ -49,7 +49,6 @@ class QSortCriterionPrivate;
class QT3DRENDERERSHARED_EXPORT QSortCriterion : public QNode
{
Q_OBJECT
- Q_ENUMS(SortType)
Q_PROPERTY(Qt3D::QSortCriterion::SortType sort READ sort WRITE setSort NOTIFY sortChanged)
public:
explicit QSortCriterion(QNode *parent = 0);
@@ -59,6 +58,7 @@ public:
BackToFront = (1 << 1),
Material = (1 << 2)
};
+ Q_ENUM(SortType)
SortType sort() const;
void setSort(SortType &sort);
diff --git a/src/render/frontend/qabstractsceneloader.h b/src/render/frontend/qabstractsceneloader.h
index 942e23744..14aa02e2a 100644
--- a/src/render/frontend/qabstractsceneloader.h
+++ b/src/render/frontend/qabstractsceneloader.h
@@ -53,7 +53,6 @@ class QAbstractSceneLoaderPrivate;
class QT3DRENDERERSHARED_EXPORT QAbstractSceneLoader : public QComponent
{
Q_OBJECT
- Q_ENUMS(Status)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
public:
@@ -64,6 +63,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(Status)
QUrl source() const;
void setSource(const QUrl &arg);
diff --git a/src/render/frontend/qabstracttextureprovider.h b/src/render/frontend/qabstracttextureprovider.h
index f177019c3..b8cad3b6e 100644
--- a/src/render/frontend/qabstracttextureprovider.h
+++ b/src/render/frontend/qabstracttextureprovider.h
@@ -52,13 +52,6 @@ class QAbstractTextureImage;
class QT3DRENDERERSHARED_EXPORT QAbstractTextureProvider : public QNode
{
Q_OBJECT
- Q_ENUMS(Target)
- Q_ENUMS(TextureFormat)
- Q_ENUMS(Filter)
- Q_ENUMS(Status)
- Q_ENUMS(ComparisonFunction)
- Q_ENUMS(ComparisonMode)
- Q_ENUMS(CubeMapFace)
Q_PROPERTY(Target target READ target CONSTANT)
Q_PROPERTY(TextureFormat format READ format WRITE setFormat NOTIFY formatChanged)
Q_PROPERTY(bool generateMipMaps READ generateMipMaps WRITE setGenerateMipMaps NOTIFY generateMipMapsChanged)
@@ -81,6 +74,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(Status)
enum Target {
Target1D = 0x0DE0, // GL_TEXTURE_1D
@@ -95,6 +89,7 @@ public:
TargetRectangle = 0x84F5, // GL_TEXTURE_RECTANGLE
TargetBuffer = 0x8C2A // GL_TEXTURE_BUFFER
};
+ Q_ENUM(Target)
enum TextureFormat {
NoFormat = 0, // GL_NONE
@@ -212,6 +207,7 @@ public:
LuminanceFormat = 0x1909, // GL_LUMINANCE
LuminanceAlphaFormat = 0x190A
};
+ Q_ENUM(TextureFormat)
enum Filter {
Nearest = 0x2600, // GL_NEAREST
@@ -221,6 +217,7 @@ public:
LinearMipMapNearest = 0x2701, // GL_LINEAR_MIPMAP_NEAREST
LinearMipMapLinear = 0x2703 // GL_LINEAR_MIPMAP_LINEAR
};
+ Q_ENUM(Filter)
enum CubeMapFace {
CubeMapPositiveX = 0x8515, // GL_TEXTURE_CUBE_MAP_POSITIVE_X
@@ -230,6 +227,7 @@ public:
CubeMapPositiveZ = 0x8519, // GL_TEXTURE_CUBE_MAP_POSITIVE_Z
CubeMapNegativeZ = 0x851A // GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
+ Q_ENUM(CubeMapFace)
enum ComparisonFunction {
CompareLessEqual = 0x0203, // GL_LEQUAL
@@ -241,11 +239,13 @@ public:
CompareAlways = 0x0207, // GL_ALWAYS
CompareNever = 0x0200 // GL_NEVER
};
+ Q_ENUM(ComparisonFunction)
enum ComparisonMode {
CompareRefToTexture = 0x884E, // GL_COMPARE_REF_TO_TEXTURE
CompareNone = 0x0000 // GL_NONE
};
+ Q_ENUM(ComparisonMode)
~QAbstractTextureProvider();
@@ -327,7 +327,5 @@ private:
QT_END_NAMESPACE
Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider*)
-Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider::ComparisonFunction)
-Q_DECLARE_METATYPE(Qt3D::QAbstractTextureProvider::ComparisonMode)
#endif // QT3D_QABSTRACTTEXTUREPROVIDER_H
diff --git a/src/render/frontend/qalphatest.h b/src/render/frontend/qalphatest.h
index 095f5aac1..645677762 100644
--- a/src/render/frontend/qalphatest.h
+++ b/src/render/frontend/qalphatest.h
@@ -49,7 +49,6 @@ class QAlphaTestPrivate;
class QT3DRENDERERSHARED_EXPORT QAlphaTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(AlphaFunc)
Q_PROPERTY(AlphaFunc func READ func WRITE setFunc NOTIFY funcChanged)
Q_PROPERTY(float clamp READ clamp WRITE setClamp NOTIFY clampChanged)
public:
@@ -64,6 +63,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(AlphaFunc)
explicit QAlphaTest(QNode *parent = 0);
diff --git a/src/render/frontend/qblendequation.h b/src/render/frontend/qblendequation.h
index 6df7cb757..280df3155 100644
--- a/src/render/frontend/qblendequation.h
+++ b/src/render/frontend/qblendequation.h
@@ -49,7 +49,6 @@ class QBlendEquationPrivate;
class QT3DRENDERERSHARED_EXPORT QBlendEquation : public QRenderState
{
Q_OBJECT
- Q_ENUMS(BlendMode)
Q_PROPERTY(BlendMode mode READ mode WRITE setMode NOTIFY modeChanged)
public:
@@ -61,6 +60,7 @@ public:
Min = 0x8007,
Max = 0x8008
};
+ Q_ENUM(BlendMode)
explicit QBlendEquation(QNode *parent = 0);
diff --git a/src/render/frontend/qblendstate.h b/src/render/frontend/qblendstate.h
index 4f5924a3c..2217944f3 100644
--- a/src/render/frontend/qblendstate.h
+++ b/src/render/frontend/qblendstate.h
@@ -49,7 +49,6 @@ class QBlendStatePrivate;
class QT3DRENDERERSHARED_EXPORT QBlendState : public QRenderState
{
Q_OBJECT
- Q_ENUMS(Blending)
Q_PROPERTY(Blending srcRGB READ srcRGB WRITE setSrcRGB NOTIFY srcRGBChanged)
Q_PROPERTY(Blending srcAlpha READ srcAlpha WRITE setSrcAlpha NOTIFY srcAlphaChanged)
Q_PROPERTY(Blending dstRGB READ dstRGB WRITE setDstRGB NOTIFY dstRGBChanged)
@@ -79,6 +78,7 @@ public:
OneMinusSrc1Alpha,
OneMinusSrc1Color0
};
+ Q_ENUM(Blending)
explicit QBlendState(QNode *parent = 0);
diff --git a/src/render/frontend/qcullface.h b/src/render/frontend/qcullface.h
index 7b30aff4d..3321e0cd0 100644
--- a/src/render/frontend/qcullface.h
+++ b/src/render/frontend/qcullface.h
@@ -50,7 +50,6 @@ class QCullFacePrivate;
class QT3DRENDERERSHARED_EXPORT QCullFace : public QRenderState
{
Q_OBJECT
- Q_ENUMS(CullingMode)
Q_PROPERTY(CullingMode mode READ mode WRITE setMode NOTIFY modeChanged)
public:
@@ -61,6 +60,7 @@ public:
Back = 0x0405,
FrontAndBack = 0x0408
};
+ Q_ENUM(CullingMode)
explicit QCullFace(QNode *parent = 0);
diff --git a/src/render/frontend/qdepthtest.h b/src/render/frontend/qdepthtest.h
index 7aa31b871..07579a4e9 100644
--- a/src/render/frontend/qdepthtest.h
+++ b/src/render/frontend/qdepthtest.h
@@ -49,7 +49,6 @@ class QDepthTestPrivate;
class QT3DRENDERERSHARED_EXPORT QDepthTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(DepthFunc)
Q_PROPERTY(DepthFunc func READ func WRITE setFunc NOTIFY funcChanged)
public:
@@ -63,6 +62,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(DepthFunc)
explicit QDepthTest(QNode *parent = 0);
diff --git a/src/render/frontend/qfrontface.h b/src/render/frontend/qfrontface.h
index b93371a3b..b1d6eb904 100644
--- a/src/render/frontend/qfrontface.h
+++ b/src/render/frontend/qfrontface.h
@@ -49,7 +49,6 @@ class QFrontFacePrivate;
class QT3DRENDERERSHARED_EXPORT QFrontFace : public QRenderState
{
Q_OBJECT
- Q_ENUMS(FaceDir)
Q_PROPERTY(FaceDir direction READ direction WRITE setDirection NOTIFY directionChanged)
public:
@@ -58,6 +57,7 @@ public:
ClockWise = 0x0900,
CounterClockWise = 0x0901
};
+ Q_ENUM(FaceDir)
explicit QFrontFace(QNode *parent = 0);
diff --git a/src/render/frontend/qopenglfilter.h b/src/render/frontend/qopenglfilter.h
index 313ce497a..c648d2b73 100644
--- a/src/render/frontend/qopenglfilter.h
+++ b/src/render/frontend/qopenglfilter.h
@@ -51,8 +51,6 @@ class QOpenGLFilterPrivate;
class QT3DRENDERERSHARED_EXPORT QOpenGLFilter : public QObject
{
Q_OBJECT
- Q_ENUMS(Api)
- Q_ENUMS(Profile)
Q_PROPERTY(Qt3D::QOpenGLFilter::Api api READ api WRITE setApi NOTIFY apiChanged)
Q_PROPERTY(Qt3D::QOpenGLFilter::Profile profile READ profile WRITE setProfile NOTIFY profileChanged)
Q_PROPERTY(int minorVersion READ minorVersion WRITE setMinorVersion NOTIFY minorVersionChanged)
@@ -67,6 +65,7 @@ public:
ES = QSurfaceFormat::OpenGLES,
Desktop = QSurfaceFormat::OpenGL
};
+ Q_ENUM(Api)
enum Profile
{
@@ -74,6 +73,7 @@ public:
Core = QSurfaceFormat::CoreProfile,
Compatibility = QSurfaceFormat::CompatibilityProfile
};
+ Q_ENUM(Profile)
explicit QOpenGLFilter(QObject *parent = 0);
diff --git a/src/render/frontend/qparametermapping.h b/src/render/frontend/qparametermapping.h
index 0373e45cc..024b5796a 100644
--- a/src/render/frontend/qparametermapping.h
+++ b/src/render/frontend/qparametermapping.h
@@ -49,7 +49,6 @@ class QParameterMappingPrivate;
class QT3DRENDERERSHARED_EXPORT QParameterMapping : public QNode
{
Q_OBJECT
- Q_ENUMS(Binding)
Q_PROPERTY(QString parameterName READ parameterName WRITE setParameterName NOTIFY parameterNameChanged)
Q_PROPERTY(QString shaderVariableName READ shaderVariableName WRITE setShaderVariableName NOTIFY shaderVariableNameChanged)
Q_PROPERTY(Binding bindingType READ bindingType WRITE setBindingType NOTIFY bindingTypeChanged)
@@ -61,6 +60,7 @@ public:
StandardUniform,
FragmentOutput
};
+ Q_ENUM(Binding)
explicit QParameterMapping(QNode *parent = 0);
QParameterMapping(const QString &parameterName, const QString &shaderParameterName, QParameterMapping::Binding bindingType, QNode *parent = 0);
diff --git a/src/render/frontend/qrenderattachment.h b/src/render/frontend/qrenderattachment.h
index e0ba0ebcc..5cdd8113b 100644
--- a/src/render/frontend/qrenderattachment.h
+++ b/src/render/frontend/qrenderattachment.h
@@ -50,8 +50,6 @@ class QRenderAttachmentPrivate;
class QT3DRENDERERSHARED_EXPORT QRenderAttachment : public QNode
{
Q_OBJECT
- Q_ENUMS(RenderAttachmentType)
- Q_ENUMS(CubeMapFace)
Q_PROPERTY(RenderAttachmentType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(Qt3D::QAbstractTextureProvider *texture READ texture WRITE setTexture NOTIFY textureChanged)
Q_PROPERTY(int mipLevel READ mipLevel WRITE setMipLevel NOTIFY mipLevelChanged)
@@ -81,6 +79,7 @@ public:
StencilAttachment,
DepthStencilAttachment
};
+ Q_ENUM(RenderAttachmentType)
enum CubeMapFace {
CubeMapPositiveX = 0x8515, // GL_TEXTURE_CUBE_MAP_POSITIVE_X
@@ -90,6 +89,7 @@ public:
CubeMapPositiveZ = 0x8519, // GL_TEXTURE_CUBE_MAP_POSITIVE_Z
CubeMapNegativeZ = 0x851A // GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
+ Q_ENUM(CubeMapFace)
explicit QRenderAttachment(QNode *parent = 0);
diff --git a/src/render/frontend/qrenderstate.h b/src/render/frontend/qrenderstate.h
index 400507212..7f428b426 100644
--- a/src/render/frontend/qrenderstate.h
+++ b/src/render/frontend/qrenderstate.h
@@ -50,7 +50,7 @@ class QRenderStatePrivate;
class QT3DRENDERERSHARED_EXPORT QRenderState : public QNode
{
Q_OBJECT
- Q_ENUMS(Type)
+
public:
enum Type {
AlphaCoverage,
@@ -68,6 +68,7 @@ public:
ScissorTest,
StencilTest
};
+ Q_ENUM(Type)
Type type() const;
diff --git a/src/render/frontend/qshaderdata.h b/src/render/frontend/qshaderdata.h
index 4459ec8e2..f526dcfc1 100644
--- a/src/render/frontend/qshaderdata.h
+++ b/src/render/frontend/qshaderdata.h
@@ -58,7 +58,6 @@ typedef QSharedPointer<PropertyReaderInterface> PropertyReaderInterfacePtr;
class QT3DRENDERERSHARED_EXPORT QShaderData : public QComponent
{
Q_OBJECT
- Q_ENUMS(TransformType)
public:
explicit QShaderData(QNode *parent = 0);
@@ -66,6 +65,7 @@ public:
ModelToEye = 0,
ModelToWorld
};
+ Q_ENUM(TransformType)
PropertyReaderInterfacePtr propertyReader() const;
diff --git a/src/render/frontend/qshaderprogram.h b/src/render/frontend/qshaderprogram.h
index 135668836..4023980a8 100644
--- a/src/render/frontend/qshaderprogram.h
+++ b/src/render/frontend/qshaderprogram.h
@@ -55,7 +55,6 @@ class QT3DRENDERERSHARED_EXPORT QShaderProgram : public QNode
Q_PROPERTY(QByteArray geometryShaderCode READ geometryShaderCode WRITE setGeometryShaderCode NOTIFY geometryShaderCodeChanged)
Q_PROPERTY(QByteArray fragmentShaderCode READ fragmentShaderCode WRITE setFragmentShaderCode NOTIFY fragmentShaderCodeChanged)
Q_PROPERTY(QByteArray computeShaderCode READ computeShaderCode WRITE setComputeShaderCode NOTIFY computeShaderCodeChanged)
- Q_ENUMS(ShaderType)
public:
explicit QShaderProgram(QNode *parent = 0);
@@ -68,6 +67,7 @@ public:
Geometry,
Compute
};
+ Q_ENUM(ShaderType)
// Source code in-line
void setVertexShaderCode(const QByteArray &vertexShaderCode);
diff --git a/src/render/frontend/qstenciltest.h b/src/render/frontend/qstenciltest.h
index 2f1072758..fdc61037b 100644
--- a/src/render/frontend/qstenciltest.h
+++ b/src/render/frontend/qstenciltest.h
@@ -49,8 +49,6 @@ class QStencilTestPrivate;
class QT3DRENDERERSHARED_EXPORT QStencilTest : public QRenderState
{
Q_OBJECT
- Q_ENUMS(StencilFaceMode)
- Q_ENUMS(StencilFunc)
Q_PROPERTY(uint mask READ mask WRITE setMask NOTIFY maskChanged)
Q_PROPERTY(StencilFaceMode faceMode READ faceMode WRITE setFaceMode NOTIFY faceModeChanged)
Q_PROPERTY(StencilFunc func READ func WRITE setFunc NOTIFY funcChanged)
@@ -62,6 +60,7 @@ public:
Back = 0x0405,
FrontAndBack = 0x0408
};
+ Q_ENUM(StencilFaceMode)
enum StencilFunc
{
@@ -74,6 +73,7 @@ public:
Greater = 0x0204,
NotEqual = 0x0205
};
+ Q_ENUM(StencilFunc)
explicit QStencilTest(QNode *parent = 0);
diff --git a/src/render/frontend/qwrapmode.h b/src/render/frontend/qwrapmode.h
index e4257c6cb..d0333c749 100644
--- a/src/render/frontend/qwrapmode.h
+++ b/src/render/frontend/qwrapmode.h
@@ -49,7 +49,6 @@ class QTextureWrapModePrivate;
class QT3DRENDERERSHARED_EXPORT QTextureWrapMode: public QObject
{
Q_OBJECT
- Q_ENUMS(WrapMode)
Q_PROPERTY(WrapMode x READ x WRITE setX NOTIFY xChanged)
Q_PROPERTY(WrapMode y READ y WRITE setY NOTIFY yChanged)
Q_PROPERTY(WrapMode z READ z WRITE setZ NOTIFY zChanged)
@@ -61,6 +60,7 @@ public:
ClampToEdge = 0x812F, // GL_CLAMP_TO_EDGE
ClampToBorder = 0x812D // GL_CLAMP_TO_BORDER
};
+ Q_ENUM(WrapMode)
explicit QTextureWrapMode(WrapMode wrapMode = ClampToEdge, QObject *parent = 0);
explicit QTextureWrapMode(WrapMode x, WrapMode y, WrapMode z, QObject *parent = 0);
diff --git a/src/render/io/abstractsceneparser_p.h b/src/render/io/abstractsceneparser_p.h
index 83257e3b9..7577cb738 100644
--- a/src/render/io/abstractsceneparser_p.h
+++ b/src/render/io/abstractsceneparser_p.h
@@ -54,7 +54,6 @@ Q_DECLARE_LOGGING_CATEGORY(SceneParsers)
class QT3DRENDERERSHARED_EXPORT AbstractSceneParser : public QObject
{
Q_OBJECT
- Q_ENUMS(ParserStatus)
Q_PROPERTY(ParserStatus parserStatus READ parserStatus NOTIFY parserStatusChanged)
Q_PROPERTY(QStringList errors READ errors NOTIFY errorsChanged)
@@ -65,6 +64,7 @@ public:
Loaded,
Error
};
+ Q_ENUM(ParserStatus)
AbstractSceneParser();
virtual ~AbstractSceneParser();