Fix binary compatibility with old generated moc files
Commit 1c623bc6d1c0a7ca52d81ca72c64f36898b3e12c introduced a new QMetaObject revision, which change the size of the QMetaEnum data. When looking up QMetaEnum in a QMetaObject, this size need to be checked for every different QMEtaObject from the hierarchy, not just the first one. Change-Id: I6f0d3982329822e15e284aef9b141d4c9ab351b9 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
5728a9d8a7
commit
6ff862a682
@ -970,9 +970,9 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, co
|
||||
int QMetaObject::indexOfEnumerator(const char *name) const
|
||||
{
|
||||
const QMetaObject *m = this;
|
||||
const int intsPerEnum = priv(m->d.data)->revision >= 8 ? 5 : 4;
|
||||
while (m) {
|
||||
const QMetaObjectPrivate *d = priv(m->d.data);
|
||||
const int intsPerEnum = d->revision >= 8 ? 5 : 4;
|
||||
for (int i = d->enumeratorCount - 1; i >= 0; --i) {
|
||||
const char *prop = rawStringData(m, m->d.data[d->enumeratorData + intsPerEnum * i]);
|
||||
if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) {
|
||||
@ -986,6 +986,7 @@ int QMetaObject::indexOfEnumerator(const char *name) const
|
||||
m = this;
|
||||
while (m) {
|
||||
const QMetaObjectPrivate *d = priv(m->d.data);
|
||||
const int intsPerEnum = d->revision >= 8 ? 5 : 4;
|
||||
for (int i = d->enumeratorCount - 1; i >= 0; --i) {
|
||||
const char *prop = rawStringData(m, m->d.data[d->enumeratorData + intsPerEnum * i + 1]);
|
||||
if (name[0] == prop[0] && strcmp(name + 1, prop + 1) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user