OSDN Git Service

Sidebar: Prevent items turning to top-level windows
authorLasse Holmstedt <lasse.holmstedt@nokia.com>
Fri, 6 Aug 2010 10:16:00 +0000 (12:16 +0200)
committerLasse Holmstedt <lasse.holmstedt@nokia.com>
Fri, 6 Aug 2010 12:03:33 +0000 (14:03 +0200)
Sometimes, this behavior occurred especially on OS X, and to lesser
extent on Linux and windows too.

Reviewed-by: Thomas Hartmann
src/plugins/coreplugin/sidebar.cpp

index 44cb0fd..e7cf5f1 100644 (file)
@@ -401,6 +401,7 @@ void SideBarWidget::setCurrentItem(const QString &id)
     m_currentItem = item;
 
     layout()->addWidget(m_currentItem->widget());
+    m_currentItem->widget()->show();
 
     // Add buttons and remember their actions for later removal
     foreach (QToolButton *b, m_currentItem->createToolBarWidgets())
@@ -436,6 +437,7 @@ void SideBarWidget::removeCurrentItem()
         return;
 
     QWidget *w = m_currentItem->widget();
+    w->hide();
     layout()->removeWidget(w);
     w->setParent(0);
     m_sideBar->makeItemAvailable(m_currentItem);