Skip to content

Commit db39c6e

Browse files
authored
Postpone hiding of properties until insertion into model is finished (backport #1508) (#1521)
* Postpone hiding of properties until insertion into model is finished (#1508) Signed-off-by: Alejandro Hernandez Cordero <[email protected]> (cherry picked from commit 4b386d3)
1 parent e5a34bf commit db39c6e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rviz_common/src/rviz_common/properties/property.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#include <QPalette> // NOLINT: cpplint is unable to handle the include order here
3939
#include <QLineEdit> // NOLINT: cpplint is unable to handle the include order here
4040
#include <QSpinBox> // NOLINT: cpplint is unable to handle the include order here
41+
#include <QString> // NOLINT: cpplint is unable to handle the include order here
42+
#include <QTimer> // NOLINT: cpplint is unable to handle the include order here
4143

4244
#include "rviz_common/properties/float_edit.hpp"
4345
#include "rviz_common/properties/property_tree_model.hpp"
@@ -384,7 +386,12 @@ void Property::setModel(PropertyTreeModel * model)
384386
{
385387
model_ = model;
386388
if (model_ && hidden_) {
387-
model_->emitPropertyHiddenChanged(this);
389+
// process propertyHiddenChanged after insertion into model has finishedAdd commentMore actions
390+
QTimer::singleShot(0, model_, [this]() {
391+
if (model_) {
392+
model_->emitPropertyHiddenChanged(this);
393+
}
394+
});
388395
}
389396
int num_children = numChildren();
390397
for (int i = 0; i < num_children; i++) {

0 commit comments

Comments
 (0)