QQmlSA: Turn BindingType into a enum class

This avoids future conflicts between different "Invalid" values.

Pick-to: 6.6
Change-Id: I42f3d6e5b6d1b46931999dc2c72177872a104be9
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fabian Kosmale 2023-08-30 10:16:47 +02:00
parent 4f5e36ac59
commit bc62914fe3
3 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ Element QQmlSA::Binding::literalType(const QQmlJSTypeResolver *resolver) const
bool Binding::hasUndefinedScriptValue() const
{
const auto &jsBinding = BindingPrivate::binding(*this);
return jsBinding.bindingType() == Script
return jsBinding.bindingType() == BindingType::Script
&& jsBinding.scriptValueType() == ScriptValue_Undefined;
}

View File

@ -12,7 +12,7 @@ class QQmlJSScope;
namespace QQmlSA {
enum BindingType : unsigned int {
enum class BindingType : unsigned int {
Invalid,
BoolLiteral,
NumberLiteral,

View File

@ -57,7 +57,7 @@ public:
? u"NULL"_s
: (value.name().isNull() ? value.baseTypeName()
: value.name()))
.arg(binding.bindingType())
.arg(qToUnderlying(binding.bindingType()))
.arg(bindingScope.baseTypeName()),
plugin, bindingScope.sourceLocation());
}