From 80a2c0061d20bd0de3fb3c01ab419eaaccc1a878 Mon Sep 17 00:00:00 2001 From: nelson Date: Fri, 26 Sep 2025 08:46:25 +0100 Subject: [PATCH 1/3] fix crash (#1587) (cherry picked from commit 9fc805430608f21027de319afa2cd68b0e4abcfb) # Conflicts: # rviz_common/src/rviz_common/properties/property_tree_widget.cpp --- .../rviz_common/properties/property_tree_widget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp index e9249c766..2e84b0c80 100644 --- a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp +++ b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp @@ -101,7 +101,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&))); @@ -117,6 +117,7 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model) void PropertyTreeWidget::propertyHiddenChanged(const Property * property) { if (model_) { +<<<<<<< HEAD const auto & parent_index = model_->parentIndex(property); if (parent_index.isValid()) { setRowHidden(property->rowNumberInParent(), parent_index, property->getHidden()); @@ -124,6 +125,16 @@ void PropertyTreeWidget::propertyHiddenChanged(const Property * property) 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())); + } +>>>>>>> 9fc80543 (fix crash (#1587)) } } } From 1801fcf10119e63cb57912ee230314208e1ba20b Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Cordero Date: Fri, 26 Sep 2025 09:52:18 +0200 Subject: [PATCH 2/3] Fixed merge Signed-off-by: Alejandro Hernandez Cordero --- .../rviz_common/properties/property_tree_widget.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp index 2e84b0c80..3bc3cc44c 100644 --- a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp +++ b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp @@ -117,15 +117,6 @@ void PropertyTreeWidget::setModel(PropertyTreeModel * model) void PropertyTreeWidget::propertyHiddenChanged(const Property * property) { if (model_) { -<<<<<<< HEAD - 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()) { @@ -134,7 +125,6 @@ void PropertyTreeWidget::propertyHiddenChanged(const Property * property) printf("Trying to hide property '%s' that is not part of the model.\n", qPrintable(property->getName())); } ->>>>>>> 9fc80543 (fix crash (#1587)) } } } From 442e34840dc253602331a657ad8ccb206a8cc0d1 Mon Sep 17 00:00:00 2001 From: Alejandro Hernandez Cordero Date: Fri, 26 Sep 2025 11:05:09 +0200 Subject: [PATCH 3/3] make linters happy Signed-off-by: Alejandro Hernandez Cordero --- .../src/rviz_common/properties/property_tree_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp index 3bc3cc44c..038051310 100644 --- a/rviz_common/src/rviz_common/properties/property_tree_widget.cpp +++ b/rviz_common/src/rviz_common/properties/property_tree_widget.cpp @@ -122,7 +122,8 @@ void PropertyTreeWidget::propertyHiddenChanged(const Property * 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", + printf( + "Trying to hide property '%s' that is not part of the model.\n", qPrintable(property->getName())); } }