aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <[email protected]>2024-05-13 15:08:25 +0200
committerThomas Hartmann <[email protected]>2024-05-14 11:30:28 +0000
commit22657af3f0d1df073c1a697d59f45dc3e2bf3c0a (patch)
tree21d7ae1ec730ade165d1fcf8612c892e934b985a
parent7ffd4805ca739c1ebe5159512b8eb8998443aaed (diff)
QmlDesigner: Use reverse iterators to support qualified scopes
Change-Id: I88a4dcbff7a50f399b81a948f273e9cf9e36782d Reviewed-by: Marco Bubke <[email protected]>
-rw-r--r--src/libs/qmlpuppetcommunication/types/enumeration.h13
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp2
2 files changed, 9 insertions, 6 deletions
diff --git a/src/libs/qmlpuppetcommunication/types/enumeration.h b/src/libs/qmlpuppetcommunication/types/enumeration.h
index 57bfe6c0ef4..5fe2294621e 100644
--- a/src/libs/qmlpuppetcommunication/types/enumeration.h
+++ b/src/libs/qmlpuppetcommunication/types/enumeration.h
@@ -43,17 +43,20 @@ public:
EnumerationNameView scope() const
{
- auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.');
- return {m_enumerationName.begin(), found};
+ auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.');
+ if (found != m_enumerationName.rend())
+ return {m_enumerationName.begin(), std::prev(found.base())};
+
+ return {m_enumerationName.end(), m_enumerationName.end()};
}
EnumerationNameView toScope() const { return scope().toByteArray(); }
EnumerationNameView name() const
{
- auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.');
- if (found != m_enumerationName.end())
- return {std::next(found), m_enumerationName.end()};
+ auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.');
+ if (found != m_enumerationName.rend())
+ return {found.base(), m_enumerationName.end()};
return {m_enumerationName.end(), m_enumerationName.end()};
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
index 412db1055fa..f8e1711d7df 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
@@ -142,7 +142,7 @@ void PropertyEditorValue::setValue(const QVariant &value)
QString PropertyEditorValue::enumeration() const
{
- return m_value.value<Enumeration>().nameToString().split('.').last();
+ return m_value.value<Enumeration>().nameToString();
}
QString PropertyEditorValue::expression() const