1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

LP-567 fix spurious Settings node expand when selecting a Data item

was due a regression in the parent() method
This commit is contained in:
Philippe Renon 2018-03-15 21:16:57 +01:00
parent 0a40850574
commit d28cf2a070

View File

@ -295,11 +295,10 @@ QModelIndex UAVObjectTreeModel::parent(const QModelIndex &index) const
return QModelIndex();
}
TreeItem *item = static_cast<TreeItem *>(index.internalPointer());
TreeItem *childItem = static_cast<TreeItem *>(index.internalPointer());
TreeItem *parentItem = childItem->parent();
TreeItem *parentItem = item->parent();
if (!parentItem) {
// item is root has no parent...
if (parentItem == m_rootItem) {
return QModelIndex();
}