forked from qt-creator/qt-creator
QmlDesigner: Use reverse iterators to support qualified scopes
Change-Id: I88a4dcbff7a50f399b81a948f273e9cf9e36782d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -43,17 +43,20 @@ public:
|
|||||||
|
|
||||||
EnumerationNameView scope() const
|
EnumerationNameView scope() const
|
||||||
{
|
{
|
||||||
auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.');
|
auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.');
|
||||||
return {m_enumerationName.begin(), found};
|
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 toScope() const { return scope().toByteArray(); }
|
||||||
|
|
||||||
EnumerationNameView name() const
|
EnumerationNameView name() const
|
||||||
{
|
{
|
||||||
auto found = std::find(m_enumerationName.begin(), m_enumerationName.end(), '.');
|
auto found = std::find(m_enumerationName.rbegin(), m_enumerationName.rend(), '.');
|
||||||
if (found != m_enumerationName.end())
|
if (found != m_enumerationName.rend())
|
||||||
return {std::next(found), m_enumerationName.end()};
|
return {found.base(), m_enumerationName.end()};
|
||||||
|
|
||||||
return {m_enumerationName.end(), m_enumerationName.end()};
|
return {m_enumerationName.end(), m_enumerationName.end()};
|
||||||
}
|
}
|
||||||
|
@@ -142,7 +142,7 @@ void PropertyEditorValue::setValue(const QVariant &value)
|
|||||||
|
|
||||||
QString PropertyEditorValue::enumeration() const
|
QString PropertyEditorValue::enumeration() const
|
||||||
{
|
{
|
||||||
return m_value.value<Enumeration>().nameToString().split('.').last();
|
return m_value.value<Enumeration>().nameToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PropertyEditorValue::expression() const
|
QString PropertyEditorValue::expression() const
|
||||||
|
Reference in New Issue
Block a user