aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertydata_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlpropertydata_p.h')
-rw-r--r--src/qml/qml/qqmlpropertydata_p.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/qml/qml/qqmlpropertydata_p.h b/src/qml/qml/qqmlpropertydata_p.h
index 2d9091edcd..f21b502b50 100644
--- a/src/qml/qml/qqmlpropertydata_p.h
+++ b/src/qml/qml/qqmlpropertydata_p.h
@@ -53,6 +53,7 @@
#include <private/qobject_p.h>
#include <QtCore/qglobal.h>
+#include <QtCore/qversionnumber.h>
QT_BEGIN_NAMESPACE
@@ -109,7 +110,7 @@ public:
unsigned isFinalORisV4Function : 1; // Has FINAL flag OR Function takes QQmlV4Function* args
unsigned isSignalHandler : 1; // Function is a signal handler
unsigned isOverload : 1; // Function is an overload of another function
- unsigned isCloned : 1; // The function was marked as cloned
+ unsigned isRequiredORisCloned : 1; // Has REQUIRED flag OR The function was marked as cloned
unsigned isConstructor : 1; // The function was marked is a constructor
unsigned isDirect : 1; // Exists on a C++ QMetaObject
unsigned isOverridden : 1; // Is overridden by a extension property
@@ -159,6 +160,11 @@ public:
isDirect = b;
}
+ void setIsRequired(bool b) {
+ Q_ASSERT(type != FunctionType);
+ isRequiredORisCloned = b;
+ }
+
void setIsVMEFunction(bool b) {
Q_ASSERT(type == FunctionType);
isConstantORisVMEFunction = b;
@@ -193,7 +199,7 @@ public:
void setIsCloned(bool b) {
Q_ASSERT(type == FunctionType);
- isCloned = b;
+ isRequiredORisCloned = b;
}
void setIsConstructor(bool b) {
@@ -224,6 +230,7 @@ public:
bool isFinal() const { return !isFunction() && m_flags.isFinalORisV4Function; }
bool isOverridden() const { return m_flags.isOverridden; }
bool isDirect() const { return m_flags.isOverload; }
+ bool isRequired() const { return !isFunction() && m_flags.isRequiredORisCloned; }
bool hasStaticMetaCallFunction() const { return staticMetaCallFunction() != nullptr; }
bool isFunction() const { return m_flags.type == Flags::FunctionType; }
bool isQObject() const { return m_flags.type == Flags::QObjectDerivedType; }
@@ -241,11 +248,11 @@ public:
bool isSignalHandler() const { return m_flags.isSignalHandler; }
bool isOverload() const { return m_flags.isOverload; }
void setOverload(bool onoff) { m_flags.isOverload = onoff; }
- bool isCloned() const { return isFunction() && m_flags.isCloned; }
+ bool isCloned() const { return isFunction() && m_flags.isRequiredORisCloned; }
bool isConstructor() const { return m_flags.isConstructor; }
bool hasOverride() const { return overrideIndex() >= 0; }
- bool hasRevision() const { return revision() != 0; }
+ bool hasRevision() const { return revision() != QTypeRevision::zero(); }
bool isFullyResolved() const { return !m_flags.notFullyResolved; }
@@ -284,12 +291,8 @@ public:
m_coreIndex = qint16(idx);
}
- quint8 revision() const { return m_revision; }
- void setRevision(quint8 rev)
- {
- Q_ASSERT(rev <= std::numeric_limits<quint8>::max());
- m_revision = quint8(rev);
- }
+ QTypeRevision revision() const { return m_revision; }
+ void setRevision(QTypeRevision revision) { m_revision = revision; }
/* If a property is a C++ type, then we store the minor
* version of this type.
@@ -309,12 +312,8 @@ public:
*
*/
- quint8 typeMinorVersion() const { return m_typeMinorVersion; }
- void setTypeMinorVersion(quint8 rev)
- {
- Q_ASSERT(rev <= std::numeric_limits<quint8>::max());
- m_typeMinorVersion = quint8(rev);
- }
+ QTypeRevision typeVersion() const { return m_typeVersion; }
+ void setTypeVersion(QTypeRevision typeVersion) { m_typeVersion = typeVersion; }
QQmlPropertyCacheMethodArguments *arguments() const { return m_arguments; }
void setArguments(QQmlPropertyCacheMethodArguments *args) { m_arguments = args; }
@@ -406,18 +405,20 @@ private:
qint16 m_notifyIndex = -1;
qint16 m_overrideIndex = -1;
- quint8 m_revision = 0;
- quint8 m_typeMinorVersion = 0;
qint16 m_metaObjectOffset = -1;
+ quint16 m_reserved = 0;
+
+ QTypeRevision m_revision = QTypeRevision::zero();
+ QTypeRevision m_typeVersion = QTypeRevision::zero();
QQmlPropertyCacheMethodArguments *m_arguments = nullptr;
StaticMetaCallFunction m_staticMetaCallFunction = nullptr;
};
#if QT_POINTER_SIZE == 4
- Q_STATIC_ASSERT(sizeof(QQmlPropertyData) == 24);
+ Q_STATIC_ASSERT(sizeof(QQmlPropertyData) == 28);
#else // QT_POINTER_SIZE == 8
- Q_STATIC_ASSERT(sizeof(QQmlPropertyData) == 32);
+ Q_STATIC_ASSERT(sizeof(QQmlPropertyData) == 40);
#endif
bool QQmlPropertyData::operator==(const QQmlPropertyData &other) const
@@ -438,7 +439,7 @@ QQmlPropertyData::Flags::Flags()
, isFinalORisV4Function(false)
, isSignalHandler(false)
, isOverload(false)
- , isCloned(false)
+ , isRequiredORisCloned(false)
, isConstructor(false)
, isOverridden(false)
, type(OtherType)
@@ -455,7 +456,7 @@ bool QQmlPropertyData::Flags::operator==(const QQmlPropertyData::Flags &other) c
isFinalORisV4Function == other.isFinalORisV4Function &&
isOverridden == other.isOverridden &&
isSignalHandler == other.isSignalHandler &&
- isCloned == other.isCloned &&
+ isRequiredORisCloned == other.isRequiredORisCloned &&
type == other.type &&
isConstructor == other.isConstructor &&
notFullyResolved == other.notFullyResolved &&