Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming of display doesn't change panel name #482

Merged
merged 1 commit into from
Apr 7, 2017

Conversation

Jntzko
Copy link
Contributor

@Jntzko Jntzko commented Apr 6, 2017

Renaming the Motion Planning Display doesn't change the name of the Motion Planning Panel
right now.

These changes overrides the function setName of the display class, since we don't have a associated widget
the setName function from display doesn't work.

Renaming the Motion Planning Display doesn't change the name of the Motion Planning Panel
right now.

These changes overrides the function setName of the display class, since we don't have a associated widget
the setName function from display doesn't work.
@jrgnicho
Copy link
Contributor

jrgnicho commented Apr 6, 2017

@Jntzko does this allow changing the Display name at runtime? I'm not sure about what this change fixes.

@Jntzko
Copy link
Contributor Author

Jntzko commented Apr 6, 2017

You can change the Display name at runtime with the rename button, this works already. What is missing is the renaming of the Panel. The Panel should get the same name as the Display, for example like the behavior of the Image Display and Panel.

@@ -305,6 +305,13 @@ void MotionPlanningDisplay::reset()
query_robot_goal_->setVisible(query_goal_state_property_->getBool());
}

void MotionPlanningDisplay::setName(const QString& name)
{
BoolProperty::setName(name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to call this static method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This static method changes the name of the Display.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant given that you are already setting the window title and the underlying QTObject name in the lines that follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BoolProperty::setName(name) sets the Display name.
setWindowTitle(name) sets the Panel name or title.
I'm not sure what setObjectName(name) does, but the original code from rviz::display says in comments:
"QMainWindow::saveState() needs objectName to be set."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jntzko it looks like the reason why BoolProperty::setName(name) works is because the MotionPlanningPanel inherits from rviz::Display which itself inherits from BoolProperty so this is not a static method but a super class call. The inherited setName() method is already implemented by the rviz::Display class and it already does call the same functions that you have added. Since the MotionPlanningPanel already has inherits this method from rviz::Display then there should be no need to override it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is, that the MotionPlanning Panel is not a "associated widget", so the functions in the rviz::Display class will not change the name of the Panel but only the name of the Display.
There was an issue why the MotionPlanning Panel can't be a "associated widget". See here #442 and here #452.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, makes sense to me.
Could you cherry pick to jade and kinetic?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrgnicho can I take that as your approval to merge+cherry-pick this as is?
Then I would directly do so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v4hn I'll merge and do the cherry pick into jade and kinetic then

@jrgnicho jrgnicho merged commit 42dfcae into moveit:indigo-devel Apr 7, 2017
jrgnicho added a commit to jrgnicho/moveit that referenced this pull request Apr 7, 2017
Renaming of display doesn't change panel name
jrgnicho added a commit to jrgnicho/moveit that referenced this pull request Apr 7, 2017
Renaming of display doesn't change panel name
jrgnicho added a commit that referenced this pull request Apr 9, 2017
jrgnicho added a commit that referenced this pull request Apr 9, 2017
JafarAbdi pushed a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
Co-authored-by: Henning Kayser <henningkayser@picknik.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants