Skip to content

Commit

Permalink
Postpone hiding of properties until insertion into model is finished
Browse files Browse the repository at this point in the history
When disabling and re-enabling a RobotModelDisplay, its hidden properties
(e.g. Alpha of a link having no geometry), were not hidden anymore.
  • Loading branch information
rhaschke committed Nov 5, 2023
1 parent 66791ab commit df72fce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rviz/properties/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <QPalette>
#include <QLineEdit>
#include <QSpinBox>
#include <QTimer>

#include <rviz/properties/float_edit.h>
#include <rviz/properties/property_tree_model.h>
Expand Down Expand Up @@ -395,7 +396,8 @@ void Property::setModel(PropertyTreeModel* model)
model_ = model;
if (model_ && hidden_)
{
model_->emitPropertyHiddenChanged(this);
// process propertyHiddenChanged after insertion into model has finished
QTimer::singleShot(0, model_, [this]() { model_->emitPropertyHiddenChanged(this); });
}
int num_children = numChildren();
for (int i = 0; i < num_children; i++)
Expand Down

0 comments on commit df72fce

Please sign in to comment.