diff options
Diffstat (limited to 'src/qmlcompiler/qqmljsscope.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsscope.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qmlcompiler/qqmljsscope.cpp b/src/qmlcompiler/qqmljsscope.cpp index e039c7b386..fcb6fab857 100644 --- a/src/qmlcompiler/qqmljsscope.cpp +++ b/src/qmlcompiler/qqmljsscope.cpp @@ -1201,6 +1201,22 @@ QQmlJSScope::InlineComponentOrDocumentRootName QQmlJSScope::enclosingInlineCompo } /*! + \internal + + Returns true if this type or any base type of it has the "EnforcesScopedEnums" flag. + The rationale is that you can turn on enforcement of scoped enums, but you cannot turn + it off explicitly. + */ +bool QQmlJSScope::enforcesScopedEnums() const +{ + for (const QQmlJSScope *scope = this; scope; scope = scope->baseType().get()) { + if (scope->hasEnforcesScopedEnumsFlag()) + return true; + } + return false; +} + +/*! \internal Returns true if the current type is creatable by checking all the required base classes. "Uncreatability" is only inherited from base types for composite types (in qml) and not for non-composite types (c++). |
