diff options
Diffstat (limited to 'src/qml/qml/qqmlcustomparser.cpp')
-rw-r--r-- | src/qml/qml/qqmlcustomparser.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlcustomparser.cpp b/src/qml/qml/qqmlcustomparser.cpp index 5e6e1187e2..b0df4f26dc 100644 --- a/src/qml/qml/qqmlcustomparser.cpp +++ b/src/qml/qml/qqmlcustomparser.cpp @@ -109,12 +109,6 @@ void QQmlCustomParser::error(const QV4::CompiledData::Location &location, const exceptions << error; } -struct StaticQtMetaObject : public QObject -{ - static const QMetaObject *get() - { return &staticQtMetaObject; } -}; - /*! If \a script is a simple enumeration expression (eg. Text.AlignLeft), returns the integer equivalent (eg. 1), and sets \a ok to true. @@ -150,12 +144,12 @@ int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const if (imports.isT1()) { QQmlImportNamespace *ns = nullptr; - if (!imports.asT1()->resolveType(scope, &type, nullptr, nullptr, &ns)) + if (!imports.asT1()->resolveType(scope, &type, nullptr, &ns)) return -1; if (!type.isValid() && ns != nullptr) { dot = nextDot(dot); if (dot == -1 || !imports.asT1()->resolveType(QString::fromUtf8(script.left(dot)), - &type, nullptr, nullptr, nullptr)) { + &type, nullptr, nullptr)) { return -1; } } @@ -184,7 +178,7 @@ int QQmlCustomParser::evaluateEnum(const QByteArray& script, bool *ok) const } QByteArray enumValue = script.mid(dot + 1); - const QMetaObject *mo = StaticQtMetaObject::get(); + const QMetaObject *mo = &Qt::staticMetaObject; int i = mo->enumeratorCount(); while (i--) { int v = mo->enumerator(i).keyToValue(enumValue.constData(), ok); |