Skip to content

Commit e5a34bf

Browse files
Don't hide rows of properties not within the model (#1507) (#1518)
(cherry picked from commit 25e5b83) Signed-off-by: Alejandro Hernandez Cordero <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 9a259bb commit e5a34bf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

rviz_common/src/rviz_common/properties/property_tree_widget.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model)
117117
void PropertyTreeWidget::propertyHiddenChanged(const Property * property)
118118
{
119119
if (model_) {
120-
setRowHidden(
121-
property->rowNumberInParent(), model_->parentIndex(property),
122-
property->getHidden() );
120+
const auto & parent_index = model_->parentIndex(property);
121+
if (parent_index.isValid()) {
122+
setRowHidden(property->rowNumberInParent(), parent_index, property->getHidden());
123+
} else {
124+
printf("Trying to hide property '%s' that is not part of the model.\n",
125+
qPrintable(property->getName()));
126+
}
123127
}
124128
}
125129

0 commit comments

Comments
 (0)