forked from qt-creator/qt-creator
QmlDesigner: Fix state group selection
The issue was caused by a mistake during branch merging. Task-number: QDS-8244 Task-number: QDS-8245 Change-Id: Ib88f0c5201229295c0cec45d806917156bd86d9f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
a7cf52cc89
commit
57d3af6d89
@@ -111,7 +111,9 @@ void StatesEditorView::setActiveStatesGroupNode(const ModelNode &modelNode)
|
||||
|
||||
int StatesEditorView::activeStatesGroupIndex() const
|
||||
{
|
||||
return 1;
|
||||
if (!model())
|
||||
return -1;
|
||||
|
||||
return Utils::indexOf(allModelNodesOfType(model()->qtQuickStateGroupMetaInfo()),
|
||||
[this](const ModelNode &node) { return node == m_activeStatesGroupNode; })
|
||||
+ 1;
|
||||
@@ -119,6 +121,9 @@ int StatesEditorView::activeStatesGroupIndex() const
|
||||
|
||||
void StatesEditorView::setActiveStatesGroupIndex(int index)
|
||||
{
|
||||
if (!model())
|
||||
return;
|
||||
|
||||
if (index > 0) {
|
||||
const ModelNode statesGroup = allModelNodesOfType(model()->qtQuickStateGroupMetaInfo())
|
||||
.at(index - 1);
|
||||
|
||||
Reference in New Issue
Block a user