From 66791ab91b9a7546a52d9300b400c7cef89adb5f Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 5 Nov 2023 11:08:47 +0100 Subject: [PATCH] Don't hide rows of properties not within the model --- src/rviz/properties/property_tree_widget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/rviz/properties/property_tree_widget.cpp b/src/rviz/properties/property_tree_widget.cpp index a935e29d6..7387eb673 100644 --- a/src/rviz/properties/property_tree_widget.cpp +++ b/src/rviz/properties/property_tree_widget.cpp @@ -37,6 +37,7 @@ #include #include +#include namespace rviz { @@ -122,7 +123,12 @@ void PropertyTreeWidget::propertyHiddenChanged(const Property* property) { if (model_) { - setRowHidden(property->rowNumberInParent(), model_->parentIndex(property), property->getHidden()); + const auto& parent_index = model_->parentIndex(property); + if (parent_index.isValid()) + setRowHidden(property->rowNumberInParent(), parent_index, property->getHidden()); + else + ROS_WARN_STREAM("Trying to hide property '" << qPrintable(property->getName()) + << "' that is not part of the model."); } }