Skip to content

Properties are not hidden when using Property::setHidden #1620

@JustusBraun

Description

@JustusBraun

Generated by Generative AI

No

Operating System:

Linux user-hostname 6.14.0-34-generic #34~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Sep 23 15:35:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ROS version or commit hash:

jazzy, rolling

RMW implementation (if applicable):

No response

RMW Configuration (if applicable):

No response

Client library (if applicable):

No response

'ros2 doctor --report' output

ros2 doctor --report
<COPY OUTPUT HERE>

Steps to reproduce issue

  1. Open RViz2
  2. Add a PointCloud2 Display
  3. The there are lots of properties shown that used to be hidden based on the selected rendering style

Expected behavior

Only the properties related to the currently selected options are shown.

Image

Actual behavior

The properties of all selectable options are shown simultaneously.

Image

Additional information

This bug is a regression and worked fine in commit 4f940dd.
I have tracked the Issue down to the changes made in commit 9fc8054 (PR #1587) . If I remove the nullptr check added in line 122 of property_tree_widget.cpp the expected behavior returns.

void PropertyTreeWidget::propertyHiddenChanged(const Property * property)
{
if (model_) {
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()));
}
}
}
}

Apparently the parent pointers of the properties are unset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions