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

Associated widget which is docked creating a tabbed panels gets disabled if tab is not visible #1738

Closed
Levi-Armstrong opened this issue Apr 20, 2022 · 10 comments · Fixed by #1739

Comments

@Levi-Armstrong
Copy link

Currently if I dock my panel on top of another panel creating tabbed panels and then you switched tab it disables the display. Is there a way to disable this functionality?

@Levi-Armstrong
Copy link
Author

Levi-Armstrong commented Apr 20, 2022

@rhaschke I believe this is a related issue but the issue shows resolved and this still appears to be happening on the noetic version.

@Levi-Armstrong
Copy link
Author

Tab Selected
image

Tab Unselected
image

@Levi-Armstrong
Copy link
Author

Then I can enable the display from the tree and the scene is visible and the tab is not which is the behavior expected.
image

@Levi-Armstrong
Copy link
Author

Levi-Armstrong commented Apr 20, 2022

A current work around is to add the following connection enabling the display on any visibility change to the panel.

connect(getAssociatedWidgetPanel(), SIGNAL( visibilityChanged( bool ) ), this, SLOT( onAssociatedPanelVisibilityChange( bool ) ));
void WorkbenchDisplay::onAssociatedPanelVisibilityChange(bool /*visible*/)
{
  setEnabled(true);
}

@Levi-Armstrong
Copy link
Author

Well actually that does not work because now the display cannot be disabled.

@Levi-Armstrong
Copy link
Author

Finally was able to create a work around.

I first had to disconnect the following signal.

disconnect(getAssociatedWidgetPanel(), SIGNAL( visibilityChanged(bool) ), this, SLOT( associatedPanelVisibilityChange(bool) ));

Then override the onEnableChanged with the following

void WorkbenchDisplay::onEnableChanged()
{
  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
  queueRender();
  /* We get here, by two different routes:
   * - First, we might have disabled the display.
   *   In this case we want to close/hide the associated widget.
   *   But there is an exception: tabbed DockWidgets shouldn't be hidden, because then we would loose the
   * tab.
   * - Second, the corresponding widget changed visibility and we got here via
   * associatedPanelVisibilityChange().
   *   In this case, it's usually counterproductive to show/hide the widget here.
   *   Typical cases are: main window was minimized/unminimized, tab was switched.
   */
  if (isEnabled())
  {
    scene_node_->setVisible(true);

    if (getAssociatedWidgetPanel() != nullptr)
    {
      getAssociatedWidgetPanel()->show();
      getAssociatedWidgetPanel()->setEnabled(true);
    }
    else if (getAssociatedWidget() != nullptr)
    {
      getAssociatedWidget()->show();
      getAssociatedWidgetPanel()->setEnabled(true);
    }

    if (isEnabled()) // status might have changed, e.g. if show() failed
      onEnable();
  }
  else
  {
    onDisable();

    if (getAssociatedWidgetPanel() != nullptr)
      getAssociatedWidgetPanel()->setDisabled(true);
    else if (getAssociatedWidget())
      getAssociatedWidget()->setDisabled(true);

    scene_node_->setVisible(false);
  }
  QApplication::restoreOverrideCursor();
}

This just disables the widget opposed to hiding and showing.

@rhaschke
Copy link
Contributor

There is a simpler solution: #1739.

@Levi-Armstrong
Copy link
Author

There is a simpler solution: #1739.

Thanks for the fix.

@rhaschke
Copy link
Contributor

@Levi-Armstrong, you seem to have implemented a fancy visual interface to Tesseract integrated into rviz. Is that already available somewhere? I couldn't find it. Can you provide a pointer?

@Levi-Armstrong
Copy link
Author

Sure, it is under a lot of development at the moment. tesseract_gui

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 a pull request may close this issue.

2 participants