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). Change-Id: I4a279653d1941faeafd95dde7a8c741009c00c72 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b3441b4127813148a701b7d538453bfdbe2315a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4eba2323f9
commit
a114fd524e
@ -859,11 +859,6 @@ void QObject::moveToThread(QThread *targetThread)
|
||||
|
||||
#include "qobjectdefs.h"
|
||||
|
||||
int QMetaObject::indexOfEnumerator(const char *name) const
|
||||
{
|
||||
return indexOfEnumerator(QByteArrayView(name));
|
||||
}
|
||||
|
||||
bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type, void *ret)
|
||||
{
|
||||
return invokeMethodImpl(object, slot, type, 1, &ret, nullptr, nullptr);
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -215,6 +215,7 @@ struct QMetaObjectPrivate
|
||||
|
||||
enum class Which { Name, Alias };
|
||||
static int indexOfEnumerator(const QMetaObject *m, QByteArrayView name, Which which);
|
||||
static int indexOfEnumerator(const QMetaObject *m, QByteArrayView name);
|
||||
|
||||
Q_CORE_EXPORT static QMetaMethod signal(const QMetaObject *m, int signal_index);
|
||||
static inline int signalOffset(const QMetaObject *m)
|
||||
|
@ -262,11 +262,7 @@ struct Q_CORE_EXPORT QMetaObject
|
||||
int indexOfMethod(const char *method) const;
|
||||
int indexOfSignal(const char *signal) const;
|
||||
int indexOfSlot(const char *slot) const;
|
||||
|
||||
#if QT_CORE_REMOVED_SINCE(6, 7)
|
||||
int indexOfEnumerator(const char *name) const;
|
||||
#endif
|
||||
int indexOfEnumerator(QByteArrayView name) const;
|
||||
|
||||
int indexOfProperty(const char *name) const;
|
||||
int indexOfClassInfo(const char *name) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user