summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2024-01-15 12:04:16 +0200
committerAhmad Samir <a.samirh78@gmail.com>2024-01-30 19:41:48 +0200
commitb3441b4127813148a701b7d538453bfdbe2315a4 (patch)
treebc8dbc215ad51bc21147f1fdefdbecadb56f7d94 /src/corelib/kernel/qmetaobject.cpp
parent8df46c8890a843a651c86d198540d6318dbaa9a1 (diff)
QMetaObject: revert adding QMetaObject::indexOfEnumerator(QBAV)
This partially reverts 4ecbe42ff44ace881ed4962744e9cd6c8fa65dab . The discussion is still ongoing to decide whether the new overload should take a QBAV or QAnySV. See https://codereview.qt-project.org/c/qt/qtbase/+/514588 for the details. For the time being remove the new overload from the API so that this can be backported to 6.7 (while keeping both dev and 6.7 in sync to ease future backports). Pick-to: 6.7 Change-Id: I4a279653d1941faeafd95dde7a8c741009c00c72 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index d45673ef25..e0181041fd 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1061,16 +1061,17 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, QB
-1.
\sa enumerator(), enumeratorCount(), enumeratorOffset()
-
- \note Starting from Qt 6.7 this method takes a \c QByteArrayView, before
- that it took a \c {const char *}. This change is source compatible i.e.
- calling this method on a \c {const char *} should still work.
*/
-int QMetaObject::indexOfEnumerator(QByteArrayView name) const
+int QMetaObject::indexOfEnumerator(const char *name) const
+{
+ return QMetaObjectPrivate::indexOfEnumerator(this, name);
+}
+
+int QMetaObjectPrivate::indexOfEnumerator(const QMetaObject *m, QByteArrayView name)
{
using W = QMetaObjectPrivate::Which;
for (auto which : { W::Name, W::Alias }) {
- if (int index = QMetaObjectPrivate::indexOfEnumerator(this, name, which); index != -1)
+ if (int index = indexOfEnumerator(m, name, which); index != -1)
return index;
}
return -1;
@@ -3661,7 +3662,7 @@ QMetaProperty::QMetaProperty(const QMetaObject *mobj, int index)
if (!(data.flags() & EnumOrFlag))
return;
QByteArrayView enum_name = typeNameFromTypeInfo(mobj, data.type());
- menum = mobj->enumerator(mobj->indexOfEnumerator(enum_name));
+ menum = mobj->enumerator(QMetaObjectPrivate::indexOfEnumerator(mobj, enum_name));
if (menum.isValid())
return;
@@ -3681,7 +3682,7 @@ QMetaProperty::QMetaProperty(const QMetaObject *mobj, int index)
scope = QMetaObject_findMetaObject(mobj, QByteArrayView(scope_name));
if (scope)
- menum = scope->enumerator(scope->indexOfEnumerator(enum_name));
+ menum = scope->enumerator(QMetaObjectPrivate::indexOfEnumerator(scope, enum_name));
}
/*!