Projects: Fix misc settings widgets if vanished targets are shown

When vanished targets where shown in Projects, clicking on the project
specific settings showed a blank page.

There were hardcoded indices for the target and the misc settings. Get
the right child for the index directly instead.

Change-Id: I725d470ad04f8a227c91938efada76a757a7442c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2024-02-23 11:49:23 +01:00
parent 8feb31b2ac
commit a9c2be1071

View File

@@ -527,11 +527,11 @@ public:
}
case PanelWidgetRole:
case ActiveItemRole:
if (m_currentChildIndex == 0)
return m_targetsItem->data(column, role);
if (m_currentChildIndex == 1)
return m_miscItem->data(column, role);
case ActiveItemRole: {
TreeItem *child = childAt(m_currentChildIndex);
if (child)
return child->data(column, role);
}
}
return {};
}