diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-04 16:26:16 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-05 16:31:56 +0200 |
commit | c2916f627373ae79bfe1407d1b7c2b41d06989eb (patch) | |
tree | dc2602796facefa5975964030366a182e58a9312 /src/qml/compiler/qv4compileddata_p.h | |
parent | e203418096e66f2173d05788e5cb18e79141e772 (diff) |
Minor internal API cleanup
Move Property::Type out into a standalone BuiltinType enum class, as
it's also used in the signal parameters (and more in the future).
Change-Id: I1125c954f6e45c7a1ce6fe2aae77c5f0e68455f5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 639595509a..f3d5de3db1 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -602,6 +602,12 @@ struct Enum }; static_assert(sizeof(Enum) == 12, "Enum structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +enum class BuiltinType : unsigned int { + Var = 0, Variant, Int, Bool, Real, String, Url, Color, + Font, Time, Date, DateTime, Rect, Point, Size, + Vector2D, Vector3D, Vector4D, Matrix4x4, Quaternion, InvalidBuiltin +}; + struct Parameter { quint32_le nameIndex; @@ -640,10 +646,6 @@ static_assert(sizeof(Signal) == 12, "Signal structure needs to have the expected struct Property { - enum Type : unsigned int { Var = 0, Variant, Int, Bool, Real, String, Url, Color, - Font, Time, Date, DateTime, Rect, Point, Size, - Vector2D, Vector3D, Vector4D, Matrix4x4, Quaternion, InvalidBuiltin }; - quint32_le nameIndex; union { quint32_le_bitfield<0, 29> builtinTypeOrTypeNameIndex; @@ -654,15 +656,15 @@ struct Property Location location; - void setBuiltinType(Type t) + void setBuiltinType(BuiltinType t) { - builtinTypeOrTypeNameIndex = t; + builtinTypeOrTypeNameIndex = static_cast<quint32>(t); isBuiltinType = true; } - Type builtinType() const { + BuiltinType builtinType() const { if (isBuiltinType) - return static_cast<Type>(quint32(builtinTypeOrTypeNameIndex)); - return InvalidBuiltin; + return static_cast<BuiltinType>(quint32(builtinTypeOrTypeNameIndex)); + return BuiltinType::InvalidBuiltin; } void setCustomType(int nameIndex) { |