7#include <private/qv4compileddata_p.h>
8#include <private/qqmlsourcecoordinate_p.h>
10#include <QtCore/qdebug.h>
72 error.setDescription(description);
87 Q_ASSERT_X(
ok,
"QQmlCustomParser::evaluateEnum",
"ok must not be a null pointer");
94 auto nextDot = [&](
int dot) {
95 const int nextDot = script.
indexOf(u
'.',
dot + 1);
96 return (nextDot == script.
size() - 1) ? -1 : nextDot;
99 int dot = nextDot(-1);
110 if (imports.
isT1()) {
115 bool recursionDetected =
false;
118 scope, &
type,
nullptr, &
ns,
nullptr,
123 if (!
type.isValid() &&
ns !=
nullptr) {
126 script.
left(
dot), &
type,
nullptr,
nullptr,
nullptr,
137 }
else if (
result.importNamespace) {
147 const int dot2 = nextDot(
dot);
148 const bool dot2Valid = (dot2 != -1);
149 const QString enumValue = script.
mid(dot2Valid ? dot2 + 1 :
dot + 1);
156 if (documentUrl.
isValid() && documentUrl ==
type.sourceUrl()) {
159 const int count = rootCache->qmlEnumCount();
160 for (
int ii = 0; ii <
count; ++ii) {
162 if (!scopedEnumName.
isEmpty() && scopedEnumName != enumData->
name)
165 for (
int jj = 0; jj < enumData->
values.size(); ++jj) {
167 if (
value.namedValue == enumValue) {
177 return type.scopedEnumValue(engine, scopedEnumName, enumValue,
ok);
179 return type.enumValue(engine, enumValue,
ok);
184 int i =
mo->enumeratorCount();
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
const QMetaObject * resolveType(const QString &) const
Resolves name to a type, or 0 if it is not a type.
void error(const QV4::CompiledData::Binding *binding, const QString &description)
int evaluateEnum(const QString &, bool *ok) const
If script is a simple enumeration expression (eg.
The QQmlError class encapsulates a QML error.
bool resolveType(const QHashedStringRef &type, QQmlType *type_return, QTypeRevision *version_return, QQmlImportNamespace **ns_return, QList< QQmlError > *errors=nullptr, QQmlType::RegistrationType registrationType=QQmlType::AnyRegistrationType, bool *typeRecursionDetected=nullptr) const
QQmlPropertyCache::ConstPtr rootPropertyCache() const
QUrl documentSourceUrl() const
Result query(const QHashedStringRef &key) const
const QMetaObject * metaObject() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QByteArray toUtf8() const &
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei count
static qreal dot(const QPointF &a, const QPointF &b)
int qmlConvertSourceCoordinate< quint32, int >(quint32 n)
#define Q_ASSERT_X(cond, x, msg)
QLatin1StringView QLatin1String
QVector< QQmlEnumValue > values