summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/itemmodels/qrangemodel_impl.h34
-rw-r--r--src/corelib/kernel/qmetaobject.cpp27
-rw-r--r--src/corelib/kernel/qmetaobject_p.h1
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp55
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder_p.h4
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/kernel/qtmocconstants.h3
-rw-r--r--src/corelib/kernel/qtmochelpers.h7
-rw-r--r--src/dbus/qdbusmetaobject.cpp3
-rw-r--r--src/gui/kernel/qguiapplication_p.h4
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp32
-rw-r--r--src/gui/math3d/qquaternion.h8
-rw-r--r--src/gui/math3d/qvectornd.cpp17
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp1
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow_p.h1
-rw-r--r--src/plugins/styles/modernwindows/qwindows11style.cpp2
-rw-r--r--src/tools/moc/generator.cpp31
-rw-r--r--src/tools/moc/generator.h10
-rw-r--r--src/tools/moc/moc.cpp65
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json3
-rw-r--r--tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json3
-rw-r--r--tests/auto/corelib/itemmodels/qrangemodeladapter/tst_qrangemodeladapter.cpp15
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp37
-rw-r--r--tests/auto/tools/moc/allmocs_baseline_in.json180
-rw-r--r--tests/auto/tools/mochelpers/tst_mochelpers.cpp7
25 files changed, 465 insertions, 87 deletions
diff --git a/src/corelib/itemmodels/qrangemodel_impl.h b/src/corelib/itemmodels/qrangemodel_impl.h
index 0233727f848..f6b08099fe7 100644
--- a/src/corelib/itemmodels/qrangemodel_impl.h
+++ b/src/corelib/itemmodels/qrangemodel_impl.h
@@ -1373,25 +1373,34 @@ public:
using multi_role = QRangeModelDetails::is_multi_role<value_type>;
auto setRangeModelDataRole = [&target, &data]{
- auto &targetRef = QRangeModelDetails::refTo(target);
constexpr auto targetMetaType = QMetaType::fromType<value_type>();
const auto dataMetaType = data.metaType();
constexpr bool isWrapped = QRangeModelDetails::is_wrapped<value_type>();
if constexpr (!std::is_copy_assignable_v<wrapped_value_type>) {
// we don't support replacing objects that are stored as raw pointers,
// as this makes object ownership very messy. But we can replace objects
- // stored in smart pointers.
- if constexpr (isWrapped && !std::is_pointer_v<value_type>
- && std::is_copy_assignable_v<value_type>) {
- if (data.canConvert(targetMetaType)) {
- target = data.value<value_type>();
- return true;
+ // stored in smart pointers, and we can initialize raw nullptr objects.
+ if constexpr (isWrapped) {
+ constexpr bool is_raw_pointer = std::is_pointer_v<value_type>;
+ if constexpr (!is_raw_pointer && std::is_copy_assignable_v<value_type>) {
+ if (data.canConvert(targetMetaType)) {
+ target = data.value<value_type>();
+ return true;
+ }
+ } else if constexpr (is_raw_pointer) {
+ if (!QRangeModelDetails::isValid(target) && data.canConvert(targetMetaType)) {
+ target = data.value<value_type>();
+ return true;
+ }
+ } else {
+ Q_UNUSED(target);
}
}
// Otherwise we have a move-only or polymorph type. fall through to
// error handling.
} else if constexpr (isWrapped) {
if (QRangeModelDetails::isValid(target)) {
+ auto &targetRef = QRangeModelDetails::refTo(target);
// we need to get a wrapped value type out of the QVariant, which
// might carry a pointer. We have to try all alternatives.
if (const auto mt = QMetaType::fromType<wrapped_value_type>();
@@ -1405,10 +1414,10 @@ public:
}
}
} else if (targetMetaType == dataMetaType) {
- targetRef = data.value<value_type>();
+ QRangeModelDetails::refTo(target) = data.value<value_type>();
return true;
} else if (dataMetaType.flags() & QMetaType::PointerToGadget) {
- targetRef = *data.value<value_type *>();
+ QRangeModelDetails::refTo(target) = *data.value<value_type *>();
return true;
}
#ifndef QT_NO_DEBUG
@@ -1463,6 +1472,13 @@ public:
};
success = writeAt(index, writeData);
+
+ if constexpr (itemsAreQObjects) {
+ if (success && isRangeModelRole(role) && this->autoConnectPolicy() == AutoConnectPolicy::Full) {
+ if (QObject *item = data.value<QObject *>())
+ Self::connectProperties(index, item, m_data.context, m_data.properties);
+ }
+ }
}
return success;
}
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 24cc58829c8..c7e50788b45 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -469,6 +469,33 @@ QMetaType QMetaObject::metaType() const
}
}
+static inline QByteArrayView objectMetaObjectHash(const QMetaObject *m)
+{
+ // metaObjectHash didn't exist before revision 14
+ if (QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && priv(m->d.data)->revision < 14)
+ return {};
+ const auto index = priv(m->d.data)->metaObjectHashIndex;
+ if (index == -1)
+ return {};
+ return stringDataView(m, index);
+}
+
+/*!
+ \since 6.11
+
+ Returns the revisioned hash of the contents of this QMetaObject or nullptr.
+
+ The hash has the following format <hash_revision>$<hash_b64>, where
+ hash_revision is an integer and hash_b64 is the base64 encoding of the
+ hash.
+
+ Note that only hashes of the same revision should be compared.
+*/
+const char *QMetaObject::metaObjectHash() const
+{
+ return objectMetaObjectHash(this).constData();
+}
+
/*!
Returns the method offset for this class; i.e. the index position
of this class's first member function.
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index bfda30fda28..7264d2a956f 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -124,6 +124,7 @@ struct QMetaObjectPrivate
int constructorCount, constructorData;
int flags;
int signalCount;
+ int metaObjectHashIndex;
static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject)
{ return reinterpret_cast<const QMetaObjectPrivate*>(metaobject->d.data); }
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index 6065bf2baea..9af6de73680 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -558,6 +558,8 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty &protot
property.setEnumOrFlag(prototype.isEnumType());
property.setConstant(prototype.isConstant());
property.setFinal(prototype.isFinal());
+ property.setVirtual(prototype.isVirtual());
+ property.setOverride(prototype.isOverride());
property.setRevision(prototype.revision());
if (prototype.hasNotifySignal()) {
// Find an existing method for the notify signal, or add a new one.
@@ -1177,10 +1179,11 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
int methodParametersDataSize = aggregateParameterCount(d->methods)
+ aggregateParameterCount(d->constructors);
if constexpr (mode == Construct) {
- static_assert(QMetaObjectPrivate::OutputRevision == 13, "QMetaObjectBuilder should generate the same version as moc");
+ static_assert(QMetaObjectPrivate::OutputRevision == 14, "QMetaObjectBuilder should generate the same version as moc");
pmeta->revision = QMetaObjectPrivate::OutputRevision;
pmeta->flags = d->flags.toInt() | AllocatedMetaObject;
pmeta->className = 0; // Class name is always the first string.
+ pmeta->metaObjectHashIndex = -1; // TODO support hash in the builder too
//pmeta->signalCount is handled in the "output method loop" as an optimization.
pmeta->classInfoCount = d->classInfoNames.size();
@@ -2068,6 +2071,32 @@ bool QMetaPropertyBuilder::isFinal() const
}
/*!
+ Returns \c true if the property is virtual; otherwise returns \c false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isVirtual() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Virtual);
+ else
+ return false;
+}
+
+/*!
+ Returns \c true if the property does override; otherwise returns \c false.
+ The default value is false.
+*/
+bool QMetaPropertyBuilder::isOverride() const
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ return d->flag(Override);
+ else
+ return false;
+}
+
+/*!
* Returns \c true if the property is an alias.
* The default value is false
*/
@@ -2239,6 +2268,30 @@ void QMetaPropertyBuilder::setFinal(bool value)
}
/*!
+ Sets the \c VIRTUAL flag on this property to \a value.
+
+ \sa isFinal()
+*/
+void QMetaPropertyBuilder::setVirtual(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Virtual, value);
+}
+
+/*!
+ Sets the \c OVERRIDE flag on this property to \a value.
+
+ \sa isOverride()
+*/
+void QMetaPropertyBuilder::setOverride(bool value)
+{
+ QMetaPropertyBuilderPrivate *d = d_func();
+ if (d)
+ d->setFlag(Override, value);
+}
+
+/*!
Sets the \c ALIAS flag on this property to \a value
*/
void QMetaPropertyBuilder::setAlias(bool value)
diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h
index 563704d60e6..9591944602a 100644
--- a/src/corelib/kernel/qmetaobjectbuilder_p.h
+++ b/src/corelib/kernel/qmetaobjectbuilder_p.h
@@ -214,6 +214,8 @@ public:
bool isEnumOrFlag() const;
bool isConstant() const;
bool isFinal() const;
+ bool isVirtual() const;
+ bool isOverride() const;
bool isAlias() const;
bool isBindable() const;
bool isRequired() const;
@@ -229,6 +231,8 @@ public:
void setEnumOrFlag(bool value);
void setConstant(bool value);
void setFinal(bool value);
+ void setVirtual(bool value);
+ void setOverride(bool value);
void setAlias(bool value);
void setBindable(bool value);
void setRequired(bool value);
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 848102cc57a..d3e761982f5 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -247,6 +247,8 @@ struct Q_CORE_EXPORT QMetaObject
QMetaType metaType() const;
+ const char *metaObjectHash() const;
+
int methodOffset() const;
int enumeratorOffset() const;
int propertyOffset() const;
diff --git a/src/corelib/kernel/qtmocconstants.h b/src/corelib/kernel/qtmocconstants.h
index 260ac2fa5f8..822e02e6c8e 100644
--- a/src/corelib/kernel/qtmocconstants.h
+++ b/src/corelib/kernel/qtmocconstants.h
@@ -30,7 +30,8 @@ namespace QtMocConstants {
// revision 11 is Qt 6.5: The metatype for void is stored in the metatypes array
// revision 12 is Qt 6.6: It adds the metatype for enums
// revision 13 is Qt 6.9: Adds support for 64-bit QFlags and moves the method revision
-enum { OutputRevision = 13 }; // Used by moc, qmetaobjectbuilder and qdbus
+// revision 14 is Qt 6.11: Adds a hash of meta object contents
+enum { OutputRevision = 14 }; // Used by moc, qmetaobjectbuilder and qdbus
enum PropertyFlags : uint {
Invalid = 0x00000000,
diff --git a/src/corelib/kernel/qtmochelpers.h b/src/corelib/kernel/qtmochelpers.h
index 4c549e78ad5..3d2b59d2a73 100644
--- a/src/corelib/kernel/qtmochelpers.h
+++ b/src/corelib/kernel/qtmochelpers.h
@@ -511,7 +511,8 @@ template <typename ObjectType, typename Unique, typename Strings,
typename Constructors = UintData<>, typename ClassInfo = detail::UintDataBlock<0, 0>>
constexpr auto metaObjectData(uint flags, const Strings &strings,
const Methods &methods, const Properties &properties,
- const Enums &enums, const Constructors &constructors = {},
+ const Enums &enums, int qt_metaObjectHashIndex = -1,
+ const Constructors &constructors = {},
const ClassInfo &classInfo = {})
{
constexpr uint MetaTypeCount = Properties::metaTypeCount()
@@ -520,7 +521,7 @@ constexpr auto metaObjectData(uint flags, const Strings &strings,
+ Methods::metaTypeCount()
+ Constructors::metaTypeCount();
- constexpr uint HeaderSize = 14;
+ constexpr uint HeaderSize = 15;
constexpr uint TotalSize = HeaderSize
+ Properties::dataSize()
+ Enums::dataSize()
@@ -582,6 +583,8 @@ constexpr auto metaObjectData(uint flags, const Strings &strings,
}
}
+ data[14] = qt_metaObjectHashIndex;
+
return result;
}
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 149392f9c3c..a4ffd7a64dd 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -383,9 +383,10 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
- methods.size(); // ditto
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
- static_assert(QMetaObjectPrivate::OutputRevision == 13, "QtDBus meta-object generator should generate the same version as moc");
+ static_assert(QMetaObjectPrivate::OutputRevision == 14, "QtDBus meta-object generator should generate the same version as moc");
header->revision = QMetaObjectPrivate::OutputRevision;
header->className = 0;
+ header->metaObjectHashIndex = -1; // TODO support hash in dbus metaobject too
header->classInfoCount = 0;
header->classInfoData = 0;
header->methodCount = int(signals_.size() + methods.size());
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index cb4702b5f7e..633ae7895ba 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -228,8 +228,8 @@ public:
// to use single-point precision.
friend constexpr bool operator==(const QLastCursorPosition &p1, const QPointF &p2) noexcept
{
- return qFuzzyCompare(float(p1.x()), float(p2.x()))
- && qFuzzyCompare(float(p1.y()), float(p2.y()));
+ return QtPrivate::fuzzyCompare(float(p1.x()), float(p2.x()))
+ && QtPrivate::fuzzyCompare(float(p1.y()), float(p2.y()));
}
friend constexpr bool operator!=(const QLastCursorPosition &p1, const QPointF &p2) noexcept
{
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index f6a06fd47ca..95b9524172f 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -738,22 +738,22 @@ QMatrix4x4 operator/(const QMatrix4x4& matrix, float divisor)
*/
bool qFuzzyCompare(const QMatrix4x4& m1, const QMatrix4x4& m2) noexcept
{
- return qFuzzyCompare(m1.m[0][0], m2.m[0][0]) &&
- qFuzzyCompare(m1.m[0][1], m2.m[0][1]) &&
- qFuzzyCompare(m1.m[0][2], m2.m[0][2]) &&
- qFuzzyCompare(m1.m[0][3], m2.m[0][3]) &&
- qFuzzyCompare(m1.m[1][0], m2.m[1][0]) &&
- qFuzzyCompare(m1.m[1][1], m2.m[1][1]) &&
- qFuzzyCompare(m1.m[1][2], m2.m[1][2]) &&
- qFuzzyCompare(m1.m[1][3], m2.m[1][3]) &&
- qFuzzyCompare(m1.m[2][0], m2.m[2][0]) &&
- qFuzzyCompare(m1.m[2][1], m2.m[2][1]) &&
- qFuzzyCompare(m1.m[2][2], m2.m[2][2]) &&
- qFuzzyCompare(m1.m[2][3], m2.m[2][3]) &&
- qFuzzyCompare(m1.m[3][0], m2.m[3][0]) &&
- qFuzzyCompare(m1.m[3][1], m2.m[3][1]) &&
- qFuzzyCompare(m1.m[3][2], m2.m[3][2]) &&
- qFuzzyCompare(m1.m[3][3], m2.m[3][3]);
+ return QtPrivate::fuzzyCompare(m1.m[0][0], m2.m[0][0])
+ && QtPrivate::fuzzyCompare(m1.m[0][1], m2.m[0][1])
+ && QtPrivate::fuzzyCompare(m1.m[0][2], m2.m[0][2])
+ && QtPrivate::fuzzyCompare(m1.m[0][3], m2.m[0][3])
+ && QtPrivate::fuzzyCompare(m1.m[1][0], m2.m[1][0])
+ && QtPrivate::fuzzyCompare(m1.m[1][1], m2.m[1][1])
+ && QtPrivate::fuzzyCompare(m1.m[1][2], m2.m[1][2])
+ && QtPrivate::fuzzyCompare(m1.m[1][3], m2.m[1][3])
+ && QtPrivate::fuzzyCompare(m1.m[2][0], m2.m[2][0])
+ && QtPrivate::fuzzyCompare(m1.m[2][1], m2.m[2][1])
+ && QtPrivate::fuzzyCompare(m1.m[2][2], m2.m[2][2])
+ && QtPrivate::fuzzyCompare(m1.m[2][3], m2.m[2][3])
+ && QtPrivate::fuzzyCompare(m1.m[3][0], m2.m[3][0])
+ && QtPrivate::fuzzyCompare(m1.m[3][1], m2.m[3][1])
+ && QtPrivate::fuzzyCompare(m1.m[3][2], m2.m[3][2])
+ && QtPrivate::fuzzyCompare(m1.m[3][3], m2.m[3][3]);
}
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index a7b1d432df7..c92e7177199 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -305,10 +305,10 @@ constexpr QQuaternion operator/(const QQuaternion &quaternion, float divisor)
constexpr bool qFuzzyCompare(const QQuaternion &q1, const QQuaternion &q2) noexcept
{
- return qFuzzyCompare(q1.wp, q2.wp) &&
- qFuzzyCompare(q1.xp, q2.xp) &&
- qFuzzyCompare(q1.yp, q2.yp) &&
- qFuzzyCompare(q1.zp, q2.zp);
+ return QtPrivate::fuzzyCompare(q1.wp, q2.wp)
+ && QtPrivate::fuzzyCompare(q1.xp, q2.xp)
+ && QtPrivate::fuzzyCompare(q1.yp, q2.yp)
+ && QtPrivate::fuzzyCompare(q1.zp, q2.zp);
}
#if QT_GUI_INLINE_IMPL_SINCE(6, 11)
diff --git a/src/gui/math3d/qvectornd.cpp b/src/gui/math3d/qvectornd.cpp
index ec836cfa56e..ee070b2b5be 100644
--- a/src/gui/math3d/qvectornd.cpp
+++ b/src/gui/math3d/qvectornd.cpp
@@ -375,7 +375,8 @@ QT_BEGIN_NAMESPACE
*/
bool qFuzzyCompare(QVector2D v1, QVector2D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) && qFuzzyCompare(v1.v[1], v2.v[1]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1]);
}
#ifndef QT_NO_VECTOR3D
@@ -979,9 +980,9 @@ QVector3D QVector3D::unproject(const QMatrix4x4 &modelView, const QMatrix4x4 &pr
*/
bool qFuzzyCompare(QVector3D v1, QVector3D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) &&
- qFuzzyCompare(v1.v[1], v2.v[1]) &&
- qFuzzyCompare(v1.v[2], v2.v[2]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1])
+ && QtPrivate::fuzzyCompare(v1.v[2], v2.v[2]);
}
#ifndef QT_NO_VECTOR2D
@@ -1501,10 +1502,10 @@ QDataStream &operator>>(QDataStream &stream, QVector3D &vector)
*/
bool qFuzzyCompare(QVector4D v1, QVector4D v2) noexcept
{
- return qFuzzyCompare(v1.v[0], v2.v[0]) &&
- qFuzzyCompare(v1.v[1], v2.v[1]) &&
- qFuzzyCompare(v1.v[2], v2.v[2]) &&
- qFuzzyCompare(v1.v[3], v2.v[3]);
+ return QtPrivate::fuzzyCompare(v1.v[0], v2.v[0])
+ && QtPrivate::fuzzyCompare(v1.v[1], v2.v[1])
+ && QtPrivate::fuzzyCompare(v1.v[2], v2.v[2])
+ && QtPrivate::fuzzyCompare(v1.v[3], v2.v[3]);
}
#ifndef QT_NO_VECTOR2D
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index f27943070d0..2be05625971 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -513,7 +513,6 @@ void QWaylandWindow::setGeometry(const QRect &r)
mWindowDecoration->update();
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window(), geometry());
- mSentInitialResize = true;
}
// Wayland has no concept of areas being exposed or not, only the entire window, when our geometry changes, we need to flag the new area as exposed
diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h
index 9e1bd92af30..7dda16cc776 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow_p.h
+++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h
@@ -334,7 +334,6 @@ protected:
int mFrameCallbackTimeout = 100;
QVariantMap m_properties;
- bool mSentInitialResize = false;
QPoint mOffset;
std::optional<qreal> mScale = std::nullopt;
diff --git a/src/plugins/styles/modernwindows/qwindows11style.cpp b/src/plugins/styles/modernwindows/qwindows11style.cpp
index 6fd857828d3..7caa352afe4 100644
--- a/src/plugins/styles/modernwindows/qwindows11style.cpp
+++ b/src/plugins/styles/modernwindows/qwindows11style.cpp
@@ -917,7 +917,7 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
const bool isReverse = option->direction == Qt::RightToLeft;
const bool isOpen = option->state & QStyle::State_Open;
QFont f(d->assetFont);
- f.setPointSize(6);
+ f.setPointSize(8);
painter->setFont(f);
painter->setPen(option->palette.color(isOpen ? QPalette::Active : QPalette::Disabled,
QPalette::WindowText));
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 6e7077b383e..94c75ae6eb3 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -78,16 +78,18 @@ QT_FOR_EACH_STATIC_TYPE(RETURN_METATYPENAME_STRING)
return nullptr;
}
- Generator::Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes,
+ Generator::Generator(Moc *moc, const ClassDef *classDef, const QList<QByteArray> &metaTypes,
const QHash<QByteArray, QByteArray> &knownQObjectClasses,
- const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile,
- bool requireCompleteTypes)
+ const QHash<QByteArray, QByteArray> &knownGadgets,
+ const QHash<QByteArray, QByteArray> &hashes,
+ FILE *outfile, bool requireCompleteTypes)
: parser(moc),
out(outfile),
cdef(classDef),
metaTypes(metaTypes),
knownQObjectClasses(knownQObjectClasses),
knownGadgets(knownGadgets),
+ hashes(hashes),
requireCompleteTypes(requireCompleteTypes)
{
if (cdef->superclassList.size())
@@ -228,28 +230,11 @@ void Generator::generateCode()
bool isQObject = (cdef->classname == "QObject");
bool isConstructible = !cdef->constructorList.isEmpty();
- // filter out undeclared enumerators and sets
- {
- QList<EnumDef> enumList;
- for (EnumDef def : std::as_const(cdef->enumList)) {
- if (cdef->enumDeclarations.contains(def.name)) {
- enumList += def;
- }
- def.enumName = def.name;
- QByteArray alias = cdef->flagAliases.value(def.name);
- if (cdef->enumDeclarations.contains(alias)) {
- def.name = alias;
- def.flags |= cdef->enumDeclarations[alias];
- enumList += def;
- }
- }
- cdef->enumList = enumList;
- }
-
//
// Register all strings used in data section
//
strreg(cdef->qualified);
+ strreg(hashes[cdef->qualified]);
registerClassInfoStrings();
registerFunctionStrings(cdef->signalList);
registerFunctionStrings(cdef->slotList);
@@ -308,6 +293,8 @@ void Generator::generateCode()
addEnums();
fprintf(out, " };\n");
+ fprintf(out, " uint qt_metaObjectHashIndex = %d;\n", stridx(hashes[cdef->qualified]));
+
const char *uintDataParams = "";
if (isConstructible || !cdef->classInfoList.isEmpty()) {
if (isConstructible) {
@@ -340,7 +327,7 @@ void Generator::generateCode()
if (!requireCompleteness)
tagType = "qt_meta_tag_" + qualifiedClassNameIdentifier + "_t";
fprintf(out, " return QtMocHelpers::metaObjectData<%s, %s>(%s, qt_stringData,\n"
- " qt_methods, qt_properties, qt_enums%s);\n"
+ " qt_methods, qt_properties, qt_enums, qt_metaObjectHashIndex%s);\n"
"}\n",
ownType, tagType.constData(), metaObjectFlags, uintDataParams);
}
diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h
index 45df0783c2b..77be2fc6714 100644
--- a/src/tools/moc/generator.h
+++ b/src/tools/moc/generator.h
@@ -12,14 +12,15 @@ class Generator
{
Moc *parser = nullptr;
FILE *out;
- ClassDef *cdef;
+ const ClassDef *cdef;
QList<uint> meta_data;
public:
- Generator(Moc *moc, ClassDef *classDef, const QList<QByteArray> &metaTypes,
+ Generator(Moc *moc, const ClassDef *classDef, const QList<QByteArray> &metaTypes,
const QHash<QByteArray, QByteArray> &knownQObjectClasses,
- const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile = nullptr,
- bool requireCompleteTypes = false);
+ const QHash<QByteArray, QByteArray> &knownGadgets,
+ const QHash<QByteArray, QByteArray> &hashes,
+ FILE *outfile = nullptr, bool requireCompleteTypes = false);
void generateCode();
qsizetype registeredStringsCount() { return strings.size(); }
@@ -54,6 +55,7 @@ private:
QList<QByteArray> metaTypes;
QHash<QByteArray, QByteArray> knownQObjectClasses;
QHash<QByteArray, QByteArray> knownGadgets;
+ QHash<QByteArray, QByteArray> hashes;
bool requireCompleteTypes;
};
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index baa6690350d..7f05f34edb6 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -17,6 +17,10 @@
#include <private/qmetaobject_moc_p.h>
#include <private/qduplicatetracker_p.h>
+// This is a bootstrapped tool, so we can't rely on QCryptographicHash for the
+// faster SHA1 implementations from OpenSSL.
+#include "../../3rdparty/sha1/sha1.cpp"
+
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@@ -1191,6 +1195,24 @@ static QByteArrayList requiredQtContainers(const QList<ClassDef> &classes)
return required;
}
+QByteArray classDefJsonObjectHash(const QJsonObject &object)
+{
+ const QByteArray json = QJsonDocument(object).toJson(QJsonValue::JsonFormat::Compact);
+ QByteArray hash(20, 0); // SHA1 produces 160 bits of data
+
+ {
+ Sha1State state;
+ sha1InitState(&state);
+ sha1Update(&state, reinterpret_cast<const uchar *>(json.constData()), json.size());
+ sha1FinalizeState(&state);
+ sha1ToHash(&state, reinterpret_cast<uchar *>(hash.data()));
+ }
+
+ static const char revisionPrefix[] = "0$";
+ const QByteArray hashB64 = hash.toBase64(QByteArray::OmitTrailingEquals);
+ return revisionPrefix + hashB64;
+}
+
void Moc::generate(FILE *out, FILE *jsonOutput)
{
QByteArrayView fn = strippedFileName();
@@ -1247,14 +1269,40 @@ void Moc::generate(FILE *out, FILE *jsonOutput)
"#endif\n\n");
#endif
+ // filter out undeclared enumerators and sets
+ for (ClassDef &cdef : classList) {
+ QList<EnumDef> enumList;
+ for (EnumDef def : std::as_const(cdef.enumList)) {
+ if (cdef.enumDeclarations.contains(def.name)) {
+ enumList += def;
+ }
+ def.enumName = def.name;
+ QByteArray alias = cdef.flagAliases.value(def.name);
+ if (cdef.enumDeclarations.contains(alias)) {
+ def.name = alias;
+ def.flags |= cdef.enumDeclarations[alias];
+ enumList += def;
+ }
+ }
+ cdef.enumList = enumList;
+ }
+
fprintf(out, "QT_WARNING_PUSH\n");
fprintf(out, "QT_WARNING_DISABLE_DEPRECATED\n");
fprintf(out, "QT_WARNING_DISABLE_GCC(\"-Wuseless-cast\")\n");
+ QHash<QByteArray, QJsonObject> classDefJsonObjects;
+ QHash<QByteArray, QByteArray> metaObjectHashes;
+ for (const ClassDef &def : std::as_const(classList)) {
+ const QJsonObject jsonObject = def.toJson();
+ classDefJsonObjects.insert(def.qualified, jsonObject);
+ metaObjectHashes.insert(def.qualified, classDefJsonObjectHash(jsonObject));
+ }
+
fputs("", out);
- for (ClassDef &def : classList) {
- Generator generator(this, &def, metaTypes, knownQObjectClasses, knownGadgets, out,
- requireCompleteTypes);
+ for (const ClassDef &def : std::as_const(classList)) {
+ Generator generator(this, &def, metaTypes, knownQObjectClasses, knownGadgets,
+ metaObjectHashes, out, requireCompleteTypes);
generator.generateCode();
// generator.generateCode() should have already registered all strings
@@ -1273,13 +1321,20 @@ void Moc::generate(FILE *out, FILE *jsonOutput)
mocData["inputFile"_L1] = QLatin1StringView(fn.constData());
QJsonArray classesJsonFormatted;
+ QJsonObject hashesJsonObject;
- for (const ClassDef &cdef: std::as_const(classList))
- classesJsonFormatted.append(cdef.toJson());
+ for (const ClassDef &cdef : std::as_const(classList)) {
+ classesJsonFormatted.append(classDefJsonObjects[cdef.qualified]);
+ hashesJsonObject.insert(QString::fromLatin1(cdef.qualified),
+ QString::fromLatin1(metaObjectHashes[cdef.qualified]));
+ }
if (!classesJsonFormatted.isEmpty())
mocData["classes"_L1] = classesJsonFormatted;
+ if (!hashesJsonObject.isEmpty())
+ mocData["hashes"_L1] = hashesJsonObject;
+
QJsonDocument jsonDoc(mocData);
fputs(jsonDoc.toJson().constData(), jsonOutput);
}
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
index 9bd20506429..28be7330cc1 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECT.json
@@ -14,6 +14,9 @@
]
}
],
+ "hashes": {
+ "MetaType": "0$swya0mP+olQ6EImtfZ4HW3dVkKs"
+ },
"inputFile": "MetaType.h",
"outputRevision": 69
}
diff --git a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
index fe80985f796..576668df12f 100644
--- a/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
+++ b/tests/auto/cmake/test_qt_extract_metatypes/test_qt_extract_metatypes_project/testdata/qt6metatypetest_metatypesQ_OBJECTandQ_PROPERTY.json
@@ -30,6 +30,9 @@
]
}
],
+ "hashes": {
+ "MetaType": "0$NMxUTKrEcV2vk8Gr4Jl/SR4Q7/c"
+ },
"inputFile": "MetaType.h",
"outputRevision": 69
}
diff --git a/tests/auto/corelib/itemmodels/qrangemodeladapter/tst_qrangemodeladapter.cpp b/tests/auto/corelib/itemmodels/qrangemodeladapter/tst_qrangemodeladapter.cpp
index eab791e57eb..4124b723b4c 100644
--- a/tests/auto/corelib/itemmodels/qrangemodeladapter/tst_qrangemodeladapter.cpp
+++ b/tests/auto/corelib/itemmodels/qrangemodeladapter/tst_qrangemodeladapter.cpp
@@ -2631,8 +2631,9 @@ public:
auto &childRows() { return m_children; }
private:
- template <std::size_t I> // read-only is enough for this
- friend decltype(auto) get(const ObjectTreeItem &row) { return row.m_objects[I]; }
+ template <std::size_t I, typename Item,
+ std::enable_if_t<std::is_same_v<q20::remove_cvref_t<Item>, ObjectTreeItem>, bool> = true>
+ friend decltype(auto) get(Item &&row) { return q23::forward_like<Item>(row.m_objects[I]); }
ObjectTreeItem *m_parentRow = nullptr;
std::optional<ObjectTree> m_children = std::nullopt;
@@ -2684,7 +2685,7 @@ void tst_QRangeModelAdapter::insertAutoConnectObjects()
Object *newGrandChild = new Object;
ObjectTreeItem newBranch(newChild);
newBranch.childRows() = ObjectTree{
- ObjectTreeItem(), // skip the first column
+ ObjectTreeItem(), // skip the first row to verify that we continue through nullptr
ObjectTreeItem(newGrandChild),
ObjectTreeItem()
};
@@ -2698,9 +2699,11 @@ void tst_QRangeModelAdapter::insertAutoConnectObjects()
QCOMPARE(dataChangedSpy.count(), 1);
dataChangedSpy.clear();
- // newGrandChild = new Object;
- // adapter.at({0, 2, 0}, 0) = newGrandChild;
- // newGrandChild->setString("0.2.0");
+ newGrandChild = new Object;
+ adapter.at({0, 2, 0}, 0) = newGrandChild;
+ QCOMPARE(dataChangedSpy.count(), 1);
+ newGrandChild->setString("0.2.0");
+ QCOMPARE(dataChangedSpy.count(), 2);
}
QTEST_MAIN(tst_QRangeModelAdapter)
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 67643606fa3..a441ed8f7ee 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -77,6 +77,9 @@ class SomethingOfEverything : public QObject
Q_PROPERTY(SomethingEnum eprop READ eprop)
Q_PROPERTY(SomethingFlagEnum fprop READ fprop)
Q_PROPERTY(QLocale::Language language READ language)
+ Q_PROPERTY(QString virtualP READ prop VIRTUAL)
+ // Doesn't override anything, used only to verify MOC handling of OVERRIDE keyword
+ Q_PROPERTY(QString overrideP READ prop OVERRIDE)
public:
Q_INVOKABLE SomethingOfEverything() {}
~SomethingOfEverything() {}
@@ -577,6 +580,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!nullProp.isEnumOrFlag());
QVERIFY(!nullProp.isConstant());
QVERIFY(!nullProp.isFinal());
+ QVERIFY(!nullProp.isVirtual());
+ QVERIFY(!nullProp.isOverride());
QCOMPARE(nullProp.index(), 0);
QCOMPARE(nullProp.revision(), 0);
@@ -596,6 +601,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop1.isEnumOrFlag());
QVERIFY(!prop1.isConstant());
QVERIFY(!prop1.isFinal());
+ QVERIFY(!prop1.isVirtual());
+ QVERIFY(!prop1.isOverride());
QCOMPARE(prop1.revision(), 0);
QCOMPARE(prop1.index(), 0);
QCOMPARE(builder.propertyCount(), 1);
@@ -616,6 +623,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
QCOMPARE(prop2.index(), 1);
QCOMPARE(builder.propertyCount(), 2);
@@ -669,6 +678,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
// Remove prop1 and check that prop2 becomes index 0.
@@ -686,6 +697,8 @@ void tst_QMetaObjectBuilder::property()
QVERIFY(!prop2.isEnumOrFlag());
QVERIFY(!prop2.isConstant());
QVERIFY(!prop2.isFinal());
+ QVERIFY(!prop2.isVirtual());
+ QVERIFY(!prop2.isOverride());
QCOMPARE(prop2.revision(), 0);
QCOMPARE(prop2.index(), 0);
@@ -711,6 +724,8 @@ void tst_QMetaObjectBuilder::property()
prop2.setEnumOrFlag(false); \
prop2.setConstant(false); \
prop2.setFinal(false); \
+ prop2.setVirtual(false); \
+ prop2.setOverride(false); \
prop2.setBindable(false); \
prop2.setRequired(false); \
} while (0)
@@ -727,6 +742,8 @@ void tst_QMetaObjectBuilder::property()
prop2.setEnumOrFlag(true); \
prop2.setConstant(true); \
prop2.setFinal(true); \
+ prop2.setVirtual(true); \
+ prop2.setOverride(true); \
prop2.setBindable(true); \
prop2.setRequired(true); \
} while (0)
@@ -742,6 +759,8 @@ void tst_QMetaObjectBuilder::property()
(prop2.isEnumOrFlag() ? 1 : 0) + \
(prop2.isConstant() ? 1 : 0) + \
(prop2.isFinal() ? 1 : 0) + \
+ (prop2.isVirtual() ? 1 : 0) + \
+ (prop2.isOverride() ? 1 : 0) + \
(prop2.isBindable() ? 1 : 0) + \
(prop2.isRequired() ? 1 : 0))
#define CHECK_FLAG(setFunc,isFunc) \
@@ -766,6 +785,8 @@ void tst_QMetaObjectBuilder::property()
CHECK_FLAG(setConstant, isConstant);
CHECK_FLAG(setBindable, isBindable);
CHECK_FLAG(setFinal, isFinal);
+ CHECK_FLAG(setVirtual, isVirtual);
+ CHECK_FLAG(setOverride, isOverride);
CHECK_FLAG(setRequired, isRequired);
SET_ALL_FLAGS();
QCOMPARE(COUNT_FLAGS(), flagCounter);
@@ -782,6 +803,22 @@ void tst_QMetaObjectBuilder::property()
QCOMPARE(prototypeProp.notifySignal().signature(), QByteArray("propChanged(QString)"));
QCOMPARE(builder.methodCount(), 1);
QCOMPARE(builder.method(0).signature(), QByteArray("propChanged(QString)"));
+
+ // virt specifiers
+ { //Q_PROPERTY(int virtualP READ prop VIRTUAL)
+ QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(7);
+ QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype);
+ QCOMPARE(prototypeProp.isVirtual(), true);
+ QCOMPARE(prototypeProp.isOverride(), false);
+ QCOMPARE(prototypeProp.isFinal(), false);
+ }
+ { // Q_PROPERTY(int overrideP READ prop OVERRIDE)
+ QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(8);
+ QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype);
+ QCOMPARE(prototypeProp.isVirtual(), false);
+ QCOMPARE(prototypeProp.isOverride(), true);
+ QCOMPARE(prototypeProp.isFinal(), false);
+ }
}
void tst_QMetaObjectBuilder::variantProperty()
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json
index d8e6c4df538..d36bdb907ae 100644
--- a/tests/auto/tools/moc/allmocs_baseline_in.json
+++ b/tests/auto/tools/moc/allmocs_baseline_in.json
@@ -23,6 +23,9 @@
]
}
],
+ "hashes": {
+ "BackslashNewlines": "0$VAkStqKr6pw5W81yZ3rCFn98h9U"
+ },
"inputFile": "backslash-newlines.h",
"outputRevision": 69
},
@@ -41,6 +44,9 @@
]
}
],
+ "hashes": {
+ "IfdefedClass": "0$OochknExuVUAqq2zc5gt2Ldj4+4"
+ },
"inputFile": "c-comments.h",
"outputRevision": 69
},
@@ -75,6 +81,9 @@
"qualifiedClassName": "CStyleEnums"
}
],
+ "hashes": {
+ "CStyleEnums": "0$fqbHabuJUT79FJr/S/6WsAiFcJI"
+ },
"inputFile": "cstyle-enums.h",
"outputRevision": 69
},
@@ -325,6 +334,11 @@
]
}
],
+ "hashes": {
+ "CXX11Enums": "0$SPzFG1raX8GCqiq6g21PoU/7ixs",
+ "CXX11Enums2": "0$uYFCI2+nT8TI8jLcKAvO8vp9OYA",
+ "CXX11Enums3": "0$bRezVo4UbDNuGatmLEd0/n8K8FA"
+ },
"inputFile": "cxx11-enums.h",
"outputRevision": 69
},
@@ -727,6 +741,17 @@
]
}
],
+ "hashes": {
+ "ExplicitOverrideControlBase": "0$PFsRqLGh0wP5gfqwF9CVeUi9EVU",
+ "ExplicitOverrideControlFinalCxx11": "0$RQTN9wEJCVZ1N4IcieHs2LuRKY8",
+ "ExplicitOverrideControlFinalCxx11OverrideCxx11": "0$ZEBCUhi5oEGiDVdmoqD+x4n1KJk",
+ "ExplicitOverrideControlFinalQt": "0$GuS6YD8Kcf/9KyehmFsrmDWW42M",
+ "ExplicitOverrideControlFinalQtOverrideQt": "0$q48mSBftA2LJFVSB4uqTmKs2gOc",
+ "ExplicitOverrideControlOverrideCxx11": "0$he1BJyFAtIcrEf74bZY1d54aCbc",
+ "ExplicitOverrideControlOverrideQt": "0$dWQ+iDw9oKEYXiSgy2izIISyRMg",
+ "ExplicitOverrideControlSealed": "0$3nq5psg7nFNDlPnBpaYraCr3CHQ",
+ "ExplicitOverrideControlSealedOverride": "0$I7ySe3SgUSARroswRh74wJoZkkA"
+ },
"inputFile": "cxx11-explicit-override-control.h",
"outputRevision": 69
},
@@ -850,6 +875,17 @@
]
}
],
+ "hashes": {
+ "ExportedFinalTestClassCpp11": "0$eUEIDQi+/lB9KOjB+oul4rZe9xE",
+ "ExportedFinalTestClassCpp11X": "0$g03sLKAEeX8BLjKjFsG3MMfunaY",
+ "ExportedFinalTestClassQt": "0$fYFeeRSmEnokVTW4eIiCU6PR5HM",
+ "ExportedFinalTestClassQtX": "0$7+xgvb70xVV3Xot9q7FhSm8mUew",
+ "ExportedSealedTestClass": "0$jzcARHlbTm1whxXOtg9edtN1ctg",
+ "ExportedSealedTestClassX": "0$tEmYiad6hqJMlGaCnNc2GhZtDgM",
+ "FinalTestClassCpp11": "0$Opb/8DnbfVjpH2CZvHo9Rv93iV8",
+ "FinalTestClassQt": "0$DtnHOKRNbQ5Y3QbO5AeLM4qYDW0",
+ "SealedTestClass": "0$VUU19XJgT+KhqRBlwQmXkd0yVgQ"
+ },
"inputFile": "cxx11-final-classes.h",
"outputRevision": 69
},
@@ -937,6 +973,9 @@
]
}
],
+ "hashes": {
+ "CXX11TrailingReturn": "0$UrmUM8dix1r2pcj94cUzTALq0x8"
+ },
"inputFile": "cxx11-trailing-return.h",
"outputRevision": 69
},
@@ -977,6 +1016,10 @@
"qualifiedClassName": "CXX17Namespace::A::B::C::D"
}
],
+ "hashes": {
+ "CXX17Namespace::A::B::C::D": "0$WwEpzp6jKMGQfcvBrtsAJOy01KM",
+ "CXX17Namespace::A::B::C::D::ClassInNamespace": "0$/g09nq8R/tK4tC37pIgfRw/mBog"
+ },
"inputFile": "cxx17-namespaces.h",
"outputRevision": 69
},
@@ -1007,6 +1050,9 @@
]
}
],
+ "hashes": {
+ "DirInIncludePath": "0$Yj0uFD5gTp9Ie67oMAyjAEUetbo"
+ },
"inputFile": "dir-in-include-path.h",
"outputRevision": 69
},
@@ -1025,6 +1071,9 @@
]
}
],
+ "hashes": {
+ "Foo": "0$CB6VdqlszayDKadxVcYxPz1KzvI"
+ },
"inputFile": "enum_with_include.h",
"outputRevision": 69
},
@@ -1057,6 +1106,9 @@
]
}
],
+ "hashes": {
+ "StringLiterals": "0$ZMhjewm0f9PVVN6Nf31Slot+IRo"
+ },
"inputFile": "escapes-in-string-literals.h",
"outputRevision": 69
},
@@ -1295,6 +1347,9 @@
]
}
],
+ "hashes": {
+ "ForwardDeclaredParamClass": "0$1v+gvQyQz9IWyRMSBZJfmhZpCw4"
+ },
"inputFile": "forward-declared-param.h",
"outputRevision": 69
},
@@ -1329,6 +1384,9 @@
]
}
],
+ "hashes": {
+ "FunctionWithAttributes": "0$PHwt9wN4wGfmeCWQSXJ4CFyLKCk"
+ },
"inputFile": "function-with-attributes.h",
"outputRevision": 69
},
@@ -1364,6 +1422,10 @@
]
}
],
+ "hashes": {
+ "DerivedGadgetWithEnums": "0$ziLf2XE3jIzXb4mHc1AtXn2Pr+w",
+ "GadgetWithNoEnums": "0$Jahs+W0ABVb+g0vSoUQ80hLQCzk"
+ },
"inputFile": "gadgetwithnoenums.h",
"outputRevision": 69
},
@@ -1400,6 +1462,11 @@
]
}
],
+ "hashes": {
+ "GrandParentGadget::BaseGadget": "0$edRI9jp0xvXAhzuu71v5ByBmvbw",
+ "GrandParentGadget::CRTPDerivedGadget": "0$Y3W4552o/BUqjdHf2NxgqKGkRmI",
+ "GrandParentGadget::DerivedGadget": "0$AhUcr6i4Hne/y216sE3UnzvaBks"
+ },
"inputFile": "grand-parent-gadget-class.h",
"outputRevision": 69
},
@@ -1471,6 +1538,10 @@
"qualifiedClassName": "SomeRandomNamespace"
}
],
+ "hashes": {
+ "SomeRandomNamespace": "0$haTJ0XROzXzF0eXH4sreUExdPxg",
+ "TestFwdProperties": "0$3+84uwm9jhX5WgZzqClAZM6h7Hg"
+ },
"inputFile": "moc_include.h",
"outputRevision": 69
},
@@ -1541,6 +1612,11 @@
"qualifiedClassName": "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace"
}
],
+ "hashes": {
+ "FooNamespace": "0$Z0uaI0MMFqu0YzU7vExYNRUcBhs",
+ "FooNamespace::FooNestedNamespace": "0$c0mGYICDOoC4QPdVm5HRH9ApH68",
+ "FooNamespace::FooNestedNamespace::FooMoreNestedNamespace": "0$FHRRWVs1L+xEcXWY318xVxYlx+Y"
+ },
"inputFile": "namespace.h",
"outputRevision": 69
},
@@ -1572,6 +1648,10 @@
]
}
],
+ "hashes": {
+ "QTBUG_101141::Base": "0$U366MOIqv3M+uAirFGzc/YkYdoA",
+ "QTBUG_101141::Derived": "0$RhyA1CgCTHJhP+oLRVIDYv85oNQ"
+ },
"inputFile": "namespaced-base-class.h",
"outputRevision": 69
},
@@ -1664,6 +1744,10 @@
]
}
],
+ "hashes": {
+ "Foo::Bar": "0$bYnwxHCP+WvK/RySc0Cz7hJ/Mv4",
+ "Foo::Baz": "0$/xEtUkDT353vJHNrTTLCovKNWyo"
+ },
"inputFile": "namespaced-flags.h",
"outputRevision": 69
},
@@ -1700,6 +1784,9 @@
]
}
],
+ "hashes": {
+ "MyBooooooostishClass": "0$RDRAZTtVcMrrVnaW3ccG5tm5kvU"
+ },
"inputFile": "no-keywords.h",
"outputRevision": 69
},
@@ -1718,6 +1805,9 @@
]
}
],
+ "hashes": {
+ "NonGadgetParent::Derived": "0$3bsnxOwlHgO7cAngQLFI5JRtpDE"
+ },
"inputFile": "non-gadget-parent-class.h",
"outputRevision": 69
},
@@ -1784,6 +1874,9 @@
]
}
],
+ "hashes": {
+ "OldStyleCast": "0$tg567Jxb/wczCGYgDo7CHjLQaF8"
+ },
"inputFile": "oldstyle-casts.h",
"outputRevision": 69
},
@@ -2027,6 +2120,9 @@
]
}
],
+ "hashes": {
+ "PD::ParseDefine": "0$gtPGvhjjReF7/9ujAvwWNaRWEdk"
+ },
"inputFile": "parse-defines.h",
"outputRevision": 69
},
@@ -2045,6 +2141,9 @@
]
}
],
+ "hashes": {
+ "TestPluginMetaData": "0$D43pha4BOvdLMUbKSF0Pw0b2rfQ"
+ },
"inputFile": "plugin_metadata.h",
"outputRevision": 69
},
@@ -2149,6 +2248,9 @@
]
}
],
+ "hashes": {
+ "TestPointeeCanBeIncomplete": "0$BXzN6PCuKk/qhZeYZaaNyUNKW/8"
+ },
"inputFile": "pointery_to_incomplete.h",
"outputRevision": 69
},
@@ -2230,6 +2332,10 @@
]
}
],
+ "hashes": {
+ "PureVirtualSignalsImpl": "0$+RHy7vy0RgivuAtQW3Dohe0R+qk",
+ "PureVirtualSignalsTest": "0$31whJazqnFwWMc3cO9MaT9wBSy8"
+ },
"inputFile": "pure-virtual-signals.h",
"outputRevision": 69
},
@@ -2302,6 +2408,10 @@
]
}
],
+ "hashes": {
+ "QEnum64Object": "0$mPIUjAUmfYvqxkkkXghMo9RAiZA",
+ "QFlags64Object": "0$o86jnlU0tZ0uyjOrEZ4/oOXAKfk"
+ },
"inputFile": "qflags64object.h",
"outputRevision": 69
},
@@ -2358,6 +2468,10 @@
]
}
],
+ "hashes": {
+ "InvokableBeforeInline": "0$t5nSESnZz1Liw62inFXd2SZTQTg",
+ "InvokableBeforeReturnType": "0$q7unyP9EifVhdxdSVIaFweQMDs4"
+ },
"inputFile": "qinvokable.h",
"outputRevision": 69
},
@@ -2397,6 +2511,9 @@
]
}
],
+ "hashes": {
+ "QmlMacro": "0$ohmDXSSvwPL9cUf7TItBqGRGOXM"
+ },
"inputFile": "qmlmacro.h",
"outputRevision": 69
},
@@ -2433,6 +2550,9 @@
]
}
],
+ "hashes": {
+ "TestQPrivateSlots": "0$akM0QTpV2o3AF3v6YBUh+iY1NsM"
+ },
"inputFile": "qprivateslots.h",
"outputRevision": 69
},
@@ -2456,6 +2576,9 @@
"qualifiedClassName": "QTBUG_35657::A"
}
],
+ "hashes": {
+ "QTBUG_35657::A": "0$ExnqnOcM0keSitP69QEKBZXt4Es"
+ },
"inputFile": "qtbug-35657-gadget.h",
"outputRevision": 69
},
@@ -2490,6 +2613,9 @@
]
}
],
+ "hashes": {
+ "QTBUG_35657::B": "0$72RlEvuVajxk55rzeym5e5E7LmA"
+ },
"inputFile": "related-metaobjects-in-gadget.h",
"outputRevision": 69
},
@@ -2547,6 +2673,10 @@
]
}
],
+ "hashes": {
+ "QTBUG_2151::A": "0$wwzOwB54lloQnRalZ9IiAf2oCII",
+ "QTBUG_2151::B": "0$b4fk7Aaf9GubBohh4VCfABMTEJM"
+ },
"inputFile": "related-metaobjects-in-namespaces.h",
"outputRevision": 69
},
@@ -3029,6 +3159,28 @@
]
}
],
+ "hashes": {
+ "NS1::DependingNestedGadget": "0$AjMR5Q0D2DupU0l/8Fl2wE0HX/w",
+ "NS1::DependingNestedObject": "0$DopB5FLdxxGgVBjg2pb8LDui8hA",
+ "NS1::DependingObject": "0$NBnkXMTHy3+HN77VtSKqsQrn2Ds",
+ "NS1::Gadget": "0$x+7FBtXOnCa+gBCDQYYJELL4q6I",
+ "NS1::Nested::Gadget": "0$QrFH5wzXn6x40CgbEt6o8+GwAEw",
+ "NS1::Nested::Object": "0$pMIVvuQb0tyLZ5mwRFw8QDUTsPE",
+ "NS1::NestedUnsused::Gadget": "0$ksUC+FXicub96bqLdCnYlMjTIQg",
+ "NS1::NestedUnsused::Object": "0$Cu9dTusUon5OJbsbCNDszsTWsk4",
+ "NS1::Object": "0$FkizYy4XPEX9QPIyL2eE9bFYc5E",
+ "NS2::DependingNestedGadget": "0$DMnk8/Na+tVbOCW2bDplJtp+qfI",
+ "NS2::DependingNestedObject": "0$us8HSPRnoTuPP+yEIj9VoF0+wgY",
+ "NS2::DependingObject": "0$Y9OXadBw3CKbCLiiIcwarWKy4Ko",
+ "NS2::Gadget": "0$1c2uSbAFT5taj/PGDXyGdXgWhk0",
+ "NS2::Nested::Gadget": "0$1Xmv0ccjZFLq/Y68TxyTQNopa8E",
+ "NS2::Nested::Object": "0$usRIIUM8ix6bMuqFyxtLIGnTAew",
+ "NS2::NestedUnsused::Gadget": "0$V8PumQY6aJmatQ/V72bPVRUyPtM",
+ "NS2::NestedUnsused::Object": "0$HJl5p4/beto2yDugYIrnCfTIRm0",
+ "NS2::Object": "0$qx8DIVSOVAgRXwqE1JjvDXnuM44",
+ "Unsused::Gadget": "0$9DYMYjqKdVlC6OknSGIF2TCoZJo",
+ "Unsused::Object": "0$KW85gaAnMYh4a0phjBcM1vGAyKw"
+ },
"inputFile": "related-metaobjects-name-conflict.h",
"outputRevision": 69
},
@@ -3070,6 +3222,9 @@
]
}
],
+ "hashes": {
+ "SignalWithDefaultArg": "0$nxiVjK8ieRlRO/uDdq0gKtPSgTU"
+ },
"inputFile": "signal-with-default-arg.h",
"outputRevision": 69
},
@@ -3099,6 +3254,9 @@
]
}
],
+ "hashes": {
+ "KDAB": "0$grAoknUYC0BkMxt4HLH2mGR4Tu8"
+ },
"inputFile": "single-quote-digit-separator-n3781.h",
"outputRevision": 69
},
@@ -3180,6 +3338,9 @@
]
}
],
+ "hashes": {
+ "SlotsWithVoidTemplateTest": "0$/08YvkDzSSJmzKO0L6t3PWzQTpA"
+ },
"inputFile": "slots-with-void-template.h",
"outputRevision": 69
},
@@ -3198,6 +3359,9 @@
]
}
],
+ "hashes": {
+ "Task192552": "0$QGM+ZcuSQWGxY2IolngyVZy8sy4"
+ },
"inputFile": "task192552.h",
"outputRevision": 69
},
@@ -3228,6 +3392,10 @@
]
}
],
+ "hashes": {
+ "NS_A::NS_B::TestObject": "0$IMqa1PfGS0EaXXK+9Ch24g/nP2A",
+ "NS_A::NS_Main::TestMain": "0$0z3ZNVKocxpdZHzRFtoTKQimUm0"
+ },
"inputFile": "task234909.h",
"outputRevision": 69
},
@@ -3403,6 +3571,9 @@
]
}
],
+ "hashes": {
+ "TypenameWithUnsigned": "0$jwklF5QEzeV58Ui5C0aT9ZFwDVo"
+ },
"inputFile": "task240368.h",
"outputRevision": 69
},
@@ -3421,6 +3592,9 @@
]
}
],
+ "hashes": {
+ "Task87883": "0$wz5QuoSTJ+0peRmMDYqL9p8q5q4"
+ },
"inputFile": "task87883.h",
"outputRevision": 69
},
@@ -3507,6 +3681,9 @@
]
}
],
+ "hashes": {
+ "MyTechPreviewObject": "0$70fB9sh1BICrgFbeYIYRC8QX+PQ"
+ },
"inputFile": "tech-preview.h",
"outputRevision": 69
},
@@ -3591,6 +3768,9 @@
]
}
],
+ "hashes": {
+ "BBB::Foo": "0$QBU7ysZZuCx+IZ4+vUQEQ84tqu8"
+ },
"inputFile": "trigraphs.h",
"outputRevision": 69
},
diff --git a/tests/auto/tools/mochelpers/tst_mochelpers.cpp b/tests/auto/tools/mochelpers/tst_mochelpers.cpp
index 7e5d18d160e..ae80f0c2b58 100644
--- a/tests/auto/tools/mochelpers/tst_mochelpers.cpp
+++ b/tests/auto/tools/mochelpers/tst_mochelpers.cpp
@@ -104,7 +104,7 @@ void tst_MocHelpers::classinfoDataGroup()
{
constexpr auto data = QtMocHelpers::metaObjectData<void, void>(0, dummyStringData,
QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
- QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
+ QtMocHelpers::UintData{}, -1, QtMocHelpers::UintData{},
QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
checkClassInfos(data.staticData.data);
}
@@ -612,7 +612,7 @@ void tst_MocHelpers::constructorUintGroup()
constexpr auto data = QtMocHelpers::metaObjectData<void, void>(0, dummyStringData,
QtMocHelpers::UintData{}, QtMocHelpers::UintData{},
- QtMocHelpers::UintData{}, constructors);
+ QtMocHelpers::UintData{}, -1, constructors);
checkConstructors(data.staticData.data, data.relocatingData.metaTypes);
}
@@ -676,7 +676,7 @@ void tst_MocHelpers::uintArrayNoMethods()
QtMocHelpers::EnumData<E2>(7, 6, EnumIsFlag | EnumIsScoped)
.add({ { 7, E2::V0 }, { 10, E2::V1 }, }),
QtMocHelpers::EnumData<QFlags<E1>>(11, 1, EnumIsFlag).add({ { 3, E1::AnEnumValue } }),
- }, QtMocHelpers::UintData{}, QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
+ }, -1, QtMocHelpers::UintData{}, QtMocHelpers::ClassInfos({{1, 2}, {3, 4}}));
auto &data = mo.staticData.data;
auto &metaTypes = mo.relocatingData.metaTypes;
@@ -724,6 +724,7 @@ void tst_MocHelpers::uintArray()
.add({ { 7, E2::V0 }, { 10, E2::V1 }, }),
QtMocHelpers::EnumData<QFlags<E1>>(11, 1, EnumIsFlag).add({ { 3, E1::AnEnumValue } }),
},
+ -1,
QtMocHelpers::UintData{
QtMocHelpers::ConstructorData<NoType(QObject *)>(1, QtMocConstants::AccessPublic,
{{ { QMetaType::QObjectStar, 2 } }}