forked from qt-creator/qt-creator
QmlDesigner: Support for ExtendedSceneEnvironment.GlowBlendMode
This is the first nested enum scope. Therefore we have to add support
for nested enum scopes.
In a subsequent patch, Enumeration has to be adjusted. This patch is
minimizing the risk for QDS 4.5.
Task-number: QDS-12645
Change-Id: I6ddfa89f3a3038eac8a7ce73c8c593191fa05b84
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
(cherry picked from commit 96bfa8e29f
)
This commit is contained in:
@@ -143,7 +143,7 @@ void PropertyEditorValue::setValue(const QVariant &value)
|
||||
|
||||
QString PropertyEditorValue::enumeration() const
|
||||
{
|
||||
return m_value.value<Enumeration>().nameToString();
|
||||
return m_value.value<Enumeration>().nameToString().split('.').last();
|
||||
}
|
||||
|
||||
QString PropertyEditorValue::expression() const
|
||||
|
@@ -94,21 +94,23 @@ bool isGlobalQtEnums(QStringView value)
|
||||
|
||||
bool isKnownEnumScopes(QStringView value)
|
||||
{
|
||||
static constexpr auto list = Utils::to_array<std::u16string_view>({u"TextInput",
|
||||
u"TextEdit",
|
||||
u"Material",
|
||||
u"Universal",
|
||||
u"Font",
|
||||
u"Shape",
|
||||
u"ShapePath",
|
||||
u"AbstractButton",
|
||||
u"Text",
|
||||
u"ShaderEffectSource",
|
||||
u"Grid",
|
||||
u"ItemLayer",
|
||||
u"ImageLayer",
|
||||
u"SpriteLayer",
|
||||
u"Light"});
|
||||
static constexpr auto list = Utils::to_array<std::u16string_view>(
|
||||
{u"TextInput",
|
||||
u"TextEdit",
|
||||
u"Material",
|
||||
u"Universal",
|
||||
u"Font",
|
||||
u"Shape",
|
||||
u"ShapePath",
|
||||
u"AbstractButton",
|
||||
u"Text",
|
||||
u"ShaderEffectSource",
|
||||
u"Grid",
|
||||
u"ItemLayer",
|
||||
u"ImageLayer",
|
||||
u"SpriteLayer",
|
||||
u"Light",
|
||||
u"ExtendedSceneEnvironment.GlowBlendMode"});
|
||||
|
||||
return std::find(std::begin(list), std::end(list), QmlDesigner::ModelUtils::toStdStringView(value))
|
||||
!= std::end(list);
|
||||
@@ -559,6 +561,11 @@ public:
|
||||
//Check for known enum scopes used globally
|
||||
if (isKnownEnumScopes(astValueList.constFirst()))
|
||||
return QVariant::fromValue(Enumeration(astValue));
|
||||
} else if (astValueList.size() == 3) {
|
||||
QString enumName = astValueList.constFirst() + '.' + astValueList.at(1);
|
||||
if (isKnownEnumScopes(enumName))
|
||||
return QVariant::fromValue(
|
||||
Enumeration(enumName.toUtf8(), astValueList.constLast().toUtf8()));
|
||||
}
|
||||
|
||||
auto eStmt = AST::cast<AST::ExpressionStatement *>(rhs);
|
||||
|
Reference in New Issue
Block a user