18#include "private/qthread_p.h"
24#include "private/qmetaobject_moc_p.h"
127 return reinterpret_cast<const char *
>(
mo->d.stringdata) +
offset;
135 const char *
string =
reinterpret_cast<const char *
>(
mo->d.stringdata) +
offset;
163 std::optional<QByteArrayView> scope;
166 const auto scopePos = qualifiedKey.lastIndexOf(
"::"_L1);
168 return R{std::nullopt, qualifiedKey};
170 return R{qualifiedKey.first(scopePos), qualifiedKey.sliced(scopePos + 2)};
178 {
return static_cast<const QMetaMethodPrivate *
>(
q); }
182 inline int typesDataIndex()
const;
183 inline const char *rawReturnTypeName()
const;
184 inline int returnType()
const;
185 inline int parameterCount()
const;
186 inline int parametersDataIndex()
const;
187 inline uint parameterTypeInfo(
int index)
const;
188 inline int parameterType(
int index)
const;
189 inline void getParameterTypes(
int *
types)
const;
193 inline QList<QByteArray> parameterTypes()
const;
194 inline QList<QByteArray> parameterNames()
const;
196 inline int ownMethodIndex()
const;
197 inline int ownConstructorMethodIndex()
const;
201 QMetaMethodPrivate();
207#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
233 const char *typeNames[] = {
235 val0.name(), val1.name(), val2.name(), val3.name(), val4.name(),
236 val5.name(), val6.name(), val7.name(), val8.name(), val9.name()
238 const void *parameters[] = {
240 val0.data(), val1.data(), val2.data(), val3.data(), val4.data(),
241 val5.data(), val6.data(), val7.data(), val8.data(), val9.data()
246 int len = int(
qstrlen(typeNames[paramCount]));
251 return newInstanceImpl(
this, paramCount, parameters, typeNames,
nullptr);
271 const void **parameters,
const char **typeNames,
274 if (!mobj->
inherits(&QObject::staticMetaObject)) {
275 qWarning(
"QMetaObject::newInstance: type %s does not inherit QObject", mobj->
className());
285 QObject *returnValue =
nullptr;
286 QMetaType returnValueMetaType = QMetaType::fromType<decltype(returnValue)>();
287 parameters[0] = &returnValue;
288 typeNames[0] = returnValueMetaType.name();
290 metaTypes[0] = returnValueMetaType.iface();
296 for (
int i = 0;
i <
priv->constructorCount; ++
i) {
297 QMetaMethod m = QMetaMethod::fromRelativeConstructorIndex(mobj,
i);
298 if (
m.parameterCount() != (paramCount - 1))
302 QMetaMethodPrivate::InvokeFailReason
r =
304 parameters, typeNames, metaTypes);
305 if (
r == QMetaMethodPrivate::InvokeFailReason::None)
320 if (!
d.static_metacall)
322 d.static_metacall(
nullptr, cl, idx, argv);
331 if (
object->d_ptr->metaObject)
332 return object->d_ptr->metaObject->metaCall(
object, cl, idx, argv);
334 return object->qt_metacall(cl, idx, argv);
375 }
while ((
m =
m->d.superdata));
395 return (
obj &&
obj->metaObject()->inherits(
this)) ?
obj :
nullptr;
398#ifndef QT_NO_TRANSLATION
417 if (
d->revision < 10) {
434#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
440 :
d->propertyCount +
d->enumeratorCount;
445 auto iface = this->d.metaTypes[
offset];
446 if (iface && QtMetaTypePrivate::isInterfaceFor<void>(iface))
550 return priv(
d.data)->constructorCount;
567 int n =
priv(
d.data)->methodCount;
570 n +=
priv(
m->d.data)->methodCount;
583 int n =
priv(
d.data)->enumeratorCount;
586 n +=
priv(
m->d.data)->enumeratorCount;
605 int n =
priv(
d.data)->propertyCount;
608 n +=
priv(
m->d.data)->propertyCount;
621 int n =
priv(
d.data)->classInfoCount;
624 n +=
priv(
m->d.data)->classInfoCount;
639 if (
priv->parameterCount() != argc)
646 int paramsIndex =
data.parameters() + 1;
647 for (
int i = 0;
i < argc; ++
i) {
648 uint typeInfo =
m->d.data[paramsIndex +
i];
671 for (
const QMetaObject *currentObject = baseObject; currentObject; currentObject = currentObject->
superClass()) {
672 const int start =
priv(currentObject->d.data)->methodCount - 1;
675 auto candidate = QMetaMethod::fromRelativeMethodIndex(currentObject,
i);
676 if (
name == candidate.name())
689template<
int MethodType>
697 ? (
priv(
m->d.data)->signalCount - 1) : (
priv(
m->d.data)->methodCount - 1);
699 ? (
priv(
m->d.data)->signalCount) : 0;
701 for (;
i >=
end; --
i) {
702 auto data = QMetaMethod::fromRelativeMethodIndex(
m,
i);
746 i = QMetaObjectPrivate::indexOfMethodRelative<0>(&
m,
name,
types.size(),
types.constData());
748 i +=
m->methodOffset();
759 if (!
types.isEmpty())
766 else if (*
str ==
'>')
771 argType.replace(
"QVector<",
"QList<");
782 const char *lparens = strchr(signature,
'(');
785 const char *rparens = strrchr(lparens + 1,
')');
786 if (!rparens || *(rparens+1))
788 int nameLength = lparens - signature;
813 i +=
m->methodOffset();
827 int i = indexOfMethodRelative<MethodSignal>(baseObject,
name, argc,
types);
830 if (
i >= 0 &&
m &&
m->d.superdata) {
833 QMetaMethod conflictMethod =
m->d.superdata->method(conflict);
834 qWarning(
"QMetaObject::indexOfSignal: signal %s from %s redefined in %s",
835 conflictMethod.methodSignature().constData(),
836 m->d.superdata->className(),
m->className());
860 i +=
m->methodOffset();
869 return indexOfMethodRelative<MethodSlot>(
m,
name, argc,
types);
877 i +=
m->methodOffset();
886 i +=
m->methodOffset();
893 int i = indexOfMethodRelative<0>(&
m,
name, argc,
types);
895 i +=
m->methodOffset();
902 for (
int i =
priv(
m->d.data)->constructorCount-1;
i >= 0; --
i) {
935 int n =
priv(
m->d.data)->signalCount;
936 for (
m =
m->d.superdata;
m;
m =
m->d.superdata)
937 n +=
priv(
m->d.data)->signalCount;
954 return QMetaMethodPrivate::get(&
m)->ownMethodIndex() +
signalOffset(
m.mobj);
968 if (signal_index < 0)
972 int i = signal_index;
974 if (i < 0 && m->
d.superdata)
975 return signal(
m->d.superdata, signal_index);
978 if (
i >= 0 &&
i <
priv(
m->d.data)->signalCount)
979 return QMetaMethod::fromRelativeMethodIndex(
m,
i);
992 if (signalArgc < methodArgc)
994 for (
int i = 0;
i < methodArgc; ++
i) {
995 if (signalTypes[
i] != methodTypes[
i])
1008 const QMetaMethodPrivate *
method)
1012 if (
signal->parameterCount() <
method->parameterCount())
1016 for (
int i = 0;
i <
method->parameterCount(); ++
i) {
1017 uint sourceTypeInfo =
signal->parameterTypeInfo(
i);
1018 uint targetTypeInfo =
method->parameterTypeInfo(
i);
1023 if (sourceName != targetName)
1028 if (sourceType != targetType)
1040 if (self->d.relatedMetaObjects) {
1042 const auto *e = self->d.relatedMetaObjects;
1051 self = self->d.superdata;
1070 for (
auto which : { W::Name, W::Alias }) {
1081 for (
int i = 0;
i <
d->enumeratorCount; ++
i) {
1086 i +=
m->enumeratorOffset();
1106 for (
int i = 0;
i <
d->propertyCount; ++
i) {
1107 const QMetaProperty::Data
data = QMetaProperty::getMetaPropertyData(
m,
i);
1109 if (strcmp(
name, prop) == 0) {
1110 i +=
m->propertyOffset();
1137 while (
m &&
i < 0) {
1138 for (
i =
priv(
m->d.data)->classInfoCount-1;
i >= 0; --
i)
1158 if (
i >= 0 &&
i <
priv(
d.data)->constructorCount)
1159 return QMetaMethod::fromRelativeConstructorIndex(
this,
i);
1172 if (
i < 0 &&
d.superdata)
1173 return d.superdata->method(
index);
1175 if (
i >= 0 &&
i <
priv(
d.data)->methodCount)
1176 return QMetaMethod::fromRelativeMethodIndex(
this,
i);
1189 if (
i < 0 &&
d.superdata)
1190 return d.superdata->enumerator(
index);
1192 if (
i >= 0 &&
i <
priv(
d.data)->enumeratorCount)
1207 if (
i < 0 &&
d.superdata)
1208 return d.superdata->property(
index);
1210 if (
i >= 0 &&
i <
priv(
d.data)->propertyCount)
1247 if (
i < 0 &&
d.superdata)
1248 return d.superdata->classInfo(
index);
1251 if (
i >= 0 &&
i <
priv(
d.data)->classInfoCount) {
1253 result.data = {
d.data +
priv(
d.data)->classInfoData +
i * QMetaClassInfo::Data::Size };
1270 while (*
s1++ !=
'(') { }
1271 while (*
s2++ !=
'(') { }
1276 if (s2len < s1len && strncmp(
s1,
s2,s2len-1)==0 &&
s1[s2len-1]==
',')
1292 QMetaMethodPrivate::get(&
signal),
1293 QMetaMethodPrivate::get(&
method));
1307 || ((*
s ==
':') && (last ==
'<')))) {
1317 while (*
d && (templdepth
1318 || (*
d !=
',' && *
d !=
')'))) {
1327 if (strncmp(
"void)",
t,
d -
t + 1) != 0)
1328 result += normalizeTypeInternal(
t,
d);
1370 QVarLengthArray<char> stackbuf(
len + 1);
1371 char *
d = stackbuf.data();
1379 if (argdepth == 1) {
1396 const char *
const *
names,
1404 candidateMessage +=
" " +
method.methodSignature() +
'\n';
1406 if (!candidateMessage.isEmpty()) {
1407 candidateMessage.prepend(
"\nCandidates are:\n");
1408 candidateMessage.chop(1);
1411 QVarLengthArray<char, 512> sig;
1419 if (paramCount != 1)
1420 sig.resize(sig.size() - 1);
1422 qWarning(
"QMetaObject::invokeMethod: No such method %s::%.*s(%.*s)%.*s",
1424 int(sig.size()), sig.constData(),
1425 int(candidateMessage.size()), candidateMessage.constData());
1562 const char *typeNames[] = {
ret.name(), val0.name(), val1.name(), val2.name(), val3.name(),
1563 val4.name(), val5.name(), val6.name(), val7.name(), val8.name(),
1565 const void *parameters[] = {
ret.data(), val0.data(), val1.data(), val2.data(), val3.data(),
1566 val4.data(), val5.data(), val6.data(), val7.data(), val8.data(),
1570 if (
qstrlen(typeNames[paramCount]) <= 0)
1573 return invokeMethodImpl(
obj, member,
type, paramCount, parameters, typeNames,
nullptr);
1577 qsizetype paramCount,
const void *
const *parameters,
1578 const char *
const *typeNames,
1596 for (
int i = 0;
i <
priv->methodCount; ++
i) {
1597 QMetaMethod m = QMetaMethod::fromRelativeMethodIndex(meta,
i);
1598 if (
m.parameterCount() != (paramCount - 1))
1604 QMetaMethodPrivate::InvokeFailReason
r =
1605 QMetaMethodPrivate::invokeImpl(
m,
obj,
type, paramCount, parameters,
1606 typeNames, metaTypes);
1608 return r == QMetaMethodPrivate::InvokeFailReason::None;
1630 bool receiverInSameThread =
false;
1632 receiverInSameThread = currentThreadId ==
QThreadData::get2(objectThread)->threadId.loadRelaxed();
1637 void **argv =
const_cast<void **
>(
params);
1639 slot->call(
object, argv);
1642 qWarning(
"QMetaObject::invokeMethod: Unable to invoke methods with return values in "
1643 "queued connections");
1646 auto event = std::make_unique<QMetaCallEvent>(std::move(slot),
nullptr, -1, parameterCount);
1647 void **
args =
event->args();
1650 for (
int i = 1;
i < parameterCount; ++
i) {
1657#if QT_CONFIG(thread)
1658 if (receiverInSameThread)
1659 qWarning(
"QMetaObject::invokeMethod: Dead lock detected");
1666 qWarning(
"QMetaObject::invokeMethod: Unknown connection type");
1900 QList<QByteArray> argTypes = parameterTypes();
1901 for (
int i = 0;
i < argTypes.size(); ++
i) {
1916int QMetaMethodPrivate::typesDataIndex()
const
1919 return data.parameters();
1922const char *QMetaMethodPrivate::rawReturnTypeName()
const
1925 uint typeInfo = mobj->
d.data[typesDataIndex()];
1932int QMetaMethodPrivate::returnType()
const
1934 return parameterType(-1);
1937int QMetaMethodPrivate::parameterCount()
const
1947 uint typeInfo = parameterTypeInfo(
index);
1958#define ASSERT_NOT_PRIMITIVE_TYPE(TYPE, METATYPEID, NAME) \
1959 Q_ASSERT(typeInfo != QMetaType::TYPE);
1961#undef ASSERT_NOT_PRIMITIVE_TYPE
1962 Q_ASSERT(typeInfo != QMetaType::QObjectStar);
1965 if (
priv(mobj->
d.data)->revision >= 11) {
1966 Q_ASSERT(typeInfo != QMetaType::Void);
1967 Q_ASSERT(typeInfo != QMetaType::VoidStar);
1972int QMetaMethodPrivate::parametersDataIndex()
const
1975 return typesDataIndex() + 1;
1978uint QMetaMethodPrivate::parameterTypeInfo(
int index)
const
1981 return mobj->
d.data[parametersDataIndex() +
index];
1991 checkMethodMetaTypeConsistency(iface, -1);
1999 const auto ifaces = &mobj->
d.metaTypes[
data.metaTypeOffset() +
offset];
2001 for (
int i = 0;
i < parameterCount(); ++
i)
2002 checkMethodMetaTypeConsistency(ifaces[
i],
i);
2007int QMetaMethodPrivate::parameterType(
int index)
const
2013void QMetaMethodPrivate::getParameterTypes(
int *
types)
const
2016 int dataIndex = parametersDataIndex();
2017 int argc = parameterCount();
2018 for (
int i = 0;
i < argc; ++
i) {
2026 int paramsIndex = parametersDataIndex();
2030QList<QByteArray> QMetaMethodPrivate::parameterTypes()
const
2033 int argc = parameterCount();
2034 QList<QByteArray>
list;
2036 int paramsIndex = parametersDataIndex();
2037 for (
int i = 0;
i < argc; ++
i) {
2044QList<QByteArray> QMetaMethodPrivate::parameterNames()
const
2047 int argc = parameterCount();
2048 QList<QByteArray>
list;
2050 int namesIndex = parametersDataIndex() + argc;
2051 for (
int i = 0;
i < argc; ++
i)
2062int QMetaMethodPrivate::ownMethodIndex()
const
2065 return (
data.d - mobj->
d.data -
priv(mobj->
d.data)->methodData)/Data::Size;
2068int QMetaMethodPrivate::ownConstructorMethodIndex()
const
2071 Q_ASSERT(methodType() == Constructor);
2072 return (
data.d - mobj->
d.data -
priv(mobj->
d.data)->constructorData)/Data::Size;
2087 return QMetaMethodPrivate::get(
this)->signature();
2101 return QMetaMethodPrivate::get(
this)->name();
2116 return returnMetaType().id();
2131 return QMetaType(QMetaMethodPrivate::get(
this)->returnType());
2147 return QMetaMethodPrivate::get(
this)->parameterCount();
2162 return parameterMetaType(
index).id();
2177 if (!mobj ||
index < 0)
2179 auto priv = QMetaMethodPrivate::get(
this);
2184 auto mt =
QMetaType(mobj->
d.metaTypes[
data.metaTypeOffset() + parameterOffset]);
2186 return QMetaType(QMetaMethodPrivate::get(
this)->parameterType(
index));
2204 QMetaMethodPrivate::get(
this)->getParameterTypes(
types);
2215 return QList<QByteArray>();
2216 return QMetaMethodPrivate::get(
this)->parameterTypes();
2228 if (!mobj || index < 0 || index >= parameterCount())
2230 return QMetaMethodPrivate::get(
this)->parameterTypeName(
index);
2241 return QList<QByteArray>();
2242 return QMetaMethodPrivate::get(
this)->parameterNames();
2255 return QMetaMethodPrivate::get(
this)->rawReturnTypeName();
2286 return QMetaMethodPrivate::get(
this)->tag().constData();
2297 return data.flags() >> 4;
2309 return QMetaMethodPrivate::get(
this)->ownMethodIndex() + mobj->
methodOffset();
2321 return QMetaMethodPrivate::get(
this)->ownMethodIndex();
2336 +
priv(mobj->
d.data)->methodCount * Data::Size
2337 + QMetaMethodPrivate::get(
this)->ownMethodIndex();
2416 return QMetaMethod::fromRelativeMethodIndex(
m,
i);
2547 if (!
object || !mobj)
2551 const char *typeNames[] = {
2580 if (
qstrlen(typeNames[paramCount]) <= 0)
2583 return invokeImpl(*
this,
object, connectionType, paramCount,
param, typeNames,
nullptr);
2587 qsizetype paramCount,
const void *
const *parameters,
2588 const char *
const *typeNames,
2591 if (!
target || !self.mobj)
2593 QMetaMethodPrivate::InvokeFailReason
r =
2594 QMetaMethodPrivate::invokeImpl(self,
target, connectionType, paramCount, parameters,
2595 typeNames, metaTypes);
2596 if (
Q_LIKELY(
r == QMetaMethodPrivate::InvokeFailReason::None))
2599 if (
int(
r) >=
int(QMetaMethodPrivate::InvokeFailReason::FormalParameterMismatch)) {
2600 int n = int(
r) - int(QMetaMethodPrivate::InvokeFailReason::FormalParameterMismatch);
2601 qWarning(
"QMetaMethod::invoke: cannot convert formal parameter %d from %s in call to %s::%s",
2602 n, typeNames[
n + 1] ? typeNames[
n + 1] : metaTypes[
n + 1]->
name,
2603 self.mobj->
className(), self.methodSignature().constData());
2605 if (
r == QMetaMethodPrivate::InvokeFailReason::TooFewArguments) {
2606 qWarning(
"QMetaMethod::invoke: too few arguments (%d) in call to %s::%s",
2614 qsizetype paramCount,
const void *
const *parameters,
2615 const char *
const *typeNames,
2619 auto priv = QMetaMethodPrivate::get(&self);
2621 auto methodMetaTypes =
priv->parameterMetaTypeInterfaces();
2622 auto param =
const_cast<void **
>(parameters);
2625 Q_ASSERT(self.methodType() == Constructor ||
object);
2627 priv->mobj->cast(
object));
2631 Q_ASSERT(MetaTypesAreOptional || metaTypes);
2634 return InvokeFailReason::TooFewArguments;
2637 auto checkTypesAreCompatible = [=](
int idx) {
2638 uint typeInfo =
priv->parameterTypeInfo(idx - 1);
2643 if (MetaTypesAreOptional && !metaTypes)
2645 return int(typeInfo) == metaTypes[idx]->
typeId;
2649 if ((MetaTypesAreOptional && !metaTypes) || !metaTypes[idx]) {
2651 if (methodTypeName == userTypeName)
2661 if (
QMetaType(methodMetaTypes[idx - 1]) == userType)
2666 if (methodMetaTypes[idx - 1])
2671 return resolved == userType;
2675 for (
qsizetype i = 0; metaTypes &&
i < paramCount; ++
i)
2680 if (!checkTypesAreCompatible(
i))
2681 return InvokeFailReason(
int(InvokeFailReason::FormalParameterMismatch) +
i - 1);
2685 if (self.methodType() == Constructor) {
2687 qWarning(
"QMetaMethod::invokeMethod: cannot call constructor %s on object %p",
2688 self.methodSignature().
constData(),
object);
2689 return InvokeFailReason::ConstructorCallOnObject;
2692 if (!parameters[0]) {
2693 qWarning(
"QMetaMethod::invokeMethod: constructor call to %s must assign a return type",
2695 return InvokeFailReason::ConstructorCallWithoutResult;
2698 if (!MetaTypesAreOptional || metaTypes) {
2699 if (metaTypes[0]->typeId != QMetaType::QObjectStar) {
2700 qWarning(
"QMetaMethod::invokeMethod: cannot convert QObject* to %s on constructor call %s",
2702 return InvokeFailReason::ReturnTypeMismatch;
2706 int idx =
priv->ownConstructorMethodIndex();
2708 return InvokeFailReason::ConstructorCallFailed;
2713 if (parameters[0]) {
2714 if (!checkTypesAreCompatible(0)) {
2715 const char *retType = typeNames[0] ? typeNames[0] : metaTypes[0]->
name;
2716 qWarning(
"QMetaMethod::invokeMethod: return type mismatch for method %s::%s:"
2717 " cannot convert from %s to %s during invocation",
2718 priv->mobj->className(),
priv->methodSignature().constData(),
2719 priv->rawReturnTypeName(), retType);
2720 return InvokeFailReason::ReturnTypeMismatch;
2725 QThread *objectThread =
nullptr;
2726 auto receiverInSameThread = [&]() {
2727 if (!currentThreadId) {
2729 objectThread =
object->thread();
2732 return currentThreadId ==
QThreadData::get2(objectThread)->threadId.loadRelaxed();
2742#if !QT_CONFIG(thread)
2749 int idx_relative =
priv->ownMethodIndex();
2750 int idx_offset =
priv->mobj->methodOffset();
2757 return InvokeFailReason::CallViaVirtualFailed;
2759 if (parameters[0]) {
2760 qWarning(
"QMetaMethod::invoke: Unable to invoke methods with return values in "
2761 "queued connections");
2762 return InvokeFailReason::CouldNotQueueParameter;
2765 auto event = std::make_unique<QMetaCallEvent>(idx_offset, idx_relative, callFunction,
nullptr, -1, paramCount);
2767 void **
args =
event->args();
2770 for (
int i = 1;
i < paramCount; ++
i) {
2772 if (!
types[
i].iface() && (!MetaTypesAreOptional || metaTypes))
2776 if (!
types[
i].iface() && typeNames[
i])
2779 qWarning(
"QMetaMethod::invoke: Unable to handle unregistered datatype '%s'",
2786 for (
int i = 1;
i < paramCount; ++
i)
2791#if QT_CONFIG(thread)
2792 if (receiverInSameThread()) {
2793 qWarning(
"QMetaMethod::invoke: Dead lock detected in BlockingQueuedConnection: "
2794 "Receiver is %s(%p)",
priv->mobj->className(),
object);
2795 return InvokeFailReason::DeadLockDetected;
2800 nullptr, -1,
param, &semaphore));
2923 if (!gadget || !mobj)
2927 if (returnValue.data()) {
2929 if (
qstrcmp(returnValue.name(), retType) != 0) {
2934 int t = returnType();
2942 const char *typeNames[] = {
2957 if (
qstrlen(typeNames[paramCount]) <= 0)
2960 if (paramCount <= QMetaMethodPrivate::get(
this)->parameterCount())
2977 int idx_relative = QMetaMethodPrivate::get(
this)->ownMethodIndex();
3103#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
3104 if (
p->revision < 12)
3108 return QMetaType(mobj->
d.metaTypes[
data.index(mobj) +
p->propertyCount]);
3120 return data.keyCount();
3148 return mobj->
d.data[
data.data() + 2 *
index + 1];
3191 return mobj ? mobj->
className() :
nullptr;
3214 && scope.
sliced(sz, 2) ==
"::"
3240 for (
int i = 0;
i < int(
data.keyCount()); ++
i) {
3245 return mobj->
d.data[
data.data() + 2 *
i + 1];
3263 for (
int i = 0;
i < int(
data.keyCount()); ++
i)
3264 if (
value == (
int)mobj->
d.data[
data.data() + 2 *
i + 1])
3273 qWarning(
"QMetaEnum::keysToValue: empty keys string.");
3279 qWarning(
"QMetaEnum::keysToValue: malformed keys string, starts with '|', \"%s\"",
3289 if (
v.endsWith(
'|')) {
3290 qWarning(
"QMetaEnum::keysToValue: malformed keys string, ends with '|', \"%s\"",
3295 const auto begin =
v.begin();
3296 const auto end =
v.end();
3303 qWarning(
"QMetaEnum::keysToValue: malformed keys string, has two consecutive '|': "
3304 "\"%s\"",
v.constData());
3332 for (
int i =
data.keyCount() - 1;
i >= 0; --
i) {
3334 return mobj->
d.data[
data.data() + 2*
i + 1];
3336 return std::nullopt;
3340 QVarLengthArray<QByteArrayView, 10>
list;
3344 for (
const auto &untrimmed :
list) {
3345 const auto parsed =
parse_scope(untrimmed.trimmed());
3346 if (parsed.scope && !
isScopeMatch(*parsed.scope,
this))
3348 if (
auto thisValue = lookup(parsed.key))
3349 value |= *thisValue;
3360template <
typename String,
typename Container,
typename Separator>
3361void join_reversed(String &
s,
const Container &
c, Separator
sep)
3370 for (
auto rit =
c.rbegin(), rend =
c.rend(); rit != rend; ++rit) {
3371 const auto &e = *rit;
3375 s.append(e.data(), e.size());
3394 for (
int i =
data.keyCount() - 1;
i >= 0; --
i) {
3395 int k = mobj->
d.data[
data.data() + 2 *
i + 1];
3396 if ((k != 0 && (
v & k) == k) || (k ==
value)) {
3401 join_reversed(
keys, parts,
'|');
3409 : mobj(mobj),
data({ mobj->
d.data +
priv(mobj->
d.data)->enumeratorData +
index * Data::Size })
3414int QMetaEnum::Data::index(
const QMetaObject *mobj)
const
3416 return (d - mobj->
d.data -
priv(mobj->
d.data)->enumeratorData) / Size;
3552int QMetaProperty::Data::index(
const QMetaObject *mobj)
const
3554 return (
d - mobj->
d.data -
priv(mobj->
d.data)->propertyData) /
Size;
3578 return data.index(mobj);
3593 return isEnumType() && menum.isFlag();
3639#if QT_DEPRECATED_SINCE(6, 4)
3648int QMetaProperty::registerPropertyType()
const
3670 scope_name = *parsed.scope;
3671 enum_name = parsed.key;
3677 if (scope_name ==
"Qt")
3678 scope = &Qt::staticMetaObject;
3690QMetaProperty::Data QMetaProperty::getMetaPropertyData(
const QMetaObject *mobj,
int index)
3692 return { mobj->
d.data +
priv(mobj->
d.data)->propertyData +
index * Data::Size };
3714 if (!
object || !mobj)
3724 void *argv[] = {
nullptr, &
value, &status };
3726 if (
t == QMetaType::fromType<QVariant>()) {
3730 argv[0] =
value.data();
3741 if (
t != QMetaType::fromType<QVariant>() && argv[0] !=
value.data())
3777 if (
t != QMetaType::fromType<QVariant>() &&
t !=
v.metaType()) {
3778 if (
isEnumType() && !
t.metaObject() &&
v.metaType().id() == QMetaType::QString) {
3787 }
else if (!
v.isValid()) {
3789 return reset(
object);
3791 }
else if (!
v.convert(
t)) {
3804 void *argv[] = {
nullptr, &
v, &status, &
flags };
3805 if (
t == QMetaType::fromType<QVariant>())
3829 void *argv[] = {
nullptr };
3864 return read(
reinterpret_cast<const QObject*
>(gadget));
3942 return data.notifyIndex() !=
uint(-1);
3972 if (!mobj ||
data.notifyIndex() == std::numeric_limits<uint>::max())
3974 uint methodIndex =
data.notifyIndex();
3977 methodIndex &= ~IsUnresolvedSignal;
3981 int idx = QMetaObjectPrivate::indexOfMethodRelative<MethodSignal>(&
m, signalName, 0,
nullptr);
3983 return idx +
m->methodOffset();
3986 idx = QMetaObjectPrivate::indexOfMethodRelative<MethodSignal>(&
m, signalName, 1, &argType);
3988 return idx +
m->methodOffset();
3989 qWarning(
"QMetaProperty::notifySignal: cannot find the NOTIFY signal %s in class %s for property '%s'",
4005 return data.revision();
4292 while (QMetaMethod::fromRelativeMethodIndex(mobj, local_method_index).
data.flags() &
MethodCloned) {
4294 --local_method_index;
4296 return local_method_index;
4306 QList<QByteArray>
list;
4307 while (*signature && *signature !=
'(')
4309 while (*signature && *signature !=
')' && *++signature !=
')') {
4310 const char *
begin = signature;
4312 while (*signature && (
level > 0 || *signature !=
',') && *signature !=
')') {
4313 if (*signature ==
'<')
4315 else if (*signature ==
'>')
bool startsWith(QByteArrayView other) const noexcept
constexpr QByteArrayView sliced(qsizetype pos) const
constexpr qsizetype size() const noexcept
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
\macro QMetaMethodArgument Q_ARG(Type, const Type &value)
reference emplace_back(Args &&... args)
void push_back(parameter_type t)
void reserve(qsizetype size)
void(* StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **)
QThread * thread() const
Returns the thread in which the object lives.
void acquire(int n=1)
Tries to acquire n resources guarded by the semaphore.
\macro QT_RESTRICTED_CAST_FROM_ASCII
const QChar * constData() const
Returns a pointer to the data stored in the QString.
static QThreadData * get2(QThread *thread)
static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION
Combined button and popup list for selecting options.
constexpr QBindableInterface iface
std::unique_ptr< QSlotObjectBase, QSlotObjectBase::Deleter > SlotObjUniquePtr
@ BlockingQueuedConnection
size_t qstrlen(const char *str)
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
#define Q_DECL_COLD_FUNCTION
#define QT_WARNING_DISABLE_GCC(text)
AudioChannelLayoutTag tag
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static QDBusError::ErrorType get(const char *name)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLenum GLuint GLint level
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum const GLint * param
GLenum GLuint GLintptr offset
GLenum GLuint GLsizei propCount
GLdouble GLdouble GLdouble GLdouble q
GLint GLenum GLboolean normalized
GLsizei const GLchar *const * string
[0]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
static constexpr QChar sep
#define QT_VERSION_CHECK(major, minor, patch)
bool testFlag(MaskType mask, FlagType flag)
const char className[16]
[1]
obj metaObject() -> className()