Skip to content

Commit

Permalink
Don't hide rows of properties not within the model
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Nov 5, 2023
1 parent c608239 commit 66791ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rviz/properties/property_tree_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <rviz/properties/status_list.h>

#include <rviz/properties/property_tree_widget.h>
#include <ros/console.h>

namespace rviz
{
Expand Down Expand Up @@ -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.");
}
}

Expand Down

0 comments on commit 66791ab

Please sign in to comment.