Closed Levi-Armstrong closed 2 years ago
@rhaschke I believe this is a related issue but the issue shows resolved and this still appears to be happening on the noetic version.
Tab Selected
Tab Unselected
Then I can enable the display from the tree and the scene is visible and the tab is not which is the behavior expected.
~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);
}
Well actually that does not work because now the display cannot be disabled.
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.
There is a simpler solution: #1739.
There is a simpler solution: #1739.
Thanks for the fix.
@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?
Sure, it is under a lot of development at the moment. tesseract_gui
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?