Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions rviz_common/src/rviz_common/properties/property_tree_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model)
if (model_) {
connect(
model_, SIGNAL(propertyHiddenChanged(const Property*)),
this, SLOT(propertyHiddenChanged(const Property*)), Qt::QueuedConnection);
this, SLOT(propertyHiddenChanged(const Property*)), Qt::DirectConnection);
connect(
model_, SIGNAL(expand(const QModelIndex&)),
this, SLOT(expand(const QModelIndex&)));
Expand All @@ -119,12 +119,14 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model)
void PropertyTreeWidget::propertyHiddenChanged(const Property * property)
{
if (model_) {
const auto & parent_index = model_->parentIndex(property);
if (parent_index.isValid()) {
setRowHidden(property->rowNumberInParent(), parent_index, property->getHidden());
} else {
printf("Trying to hide property '%s' that is not part of the model.\n",
qPrintable(property->getName()));
if (property->parent() != nullptr) {
const auto & parent_index = model_->parentIndex(property);
if (parent_index.isValid()) {
setRowHidden(property->rowNumberInParent(), parent_index, property->getHidden());
} else {
printf("Trying to hide property '%s' that is not part of the model.\n",
qPrintable(property->getName()));
}
}
}
}
Expand Down