see #1998 an attempt to make sure signals that we use to update state of the tree panel are disconnected when user closes project panel

This commit is contained in:
Vadim Kurland
2011-01-27 20:31:41 -08:00
parent 8e0159f197
commit 266bf34ecb
+17 -8
View File
@@ -104,13 +104,10 @@ void ProjectPanel::initMain(FWWindow *main)
main->undoGroup->addStack(undoStack); main->undoGroup->addStack(undoStack);
connect(m_panel->treeDockWidget, SIGNAL(topLevelChanged(bool)), // connect(m_panel->treeDockWidget, SIGNAL(topLevelChanged(bool)),
this, SLOT(topLevelChangedForTreePanel(bool))); // this, SLOT(topLevelChangedForTreePanel(bool)));
connect(m_panel->treeDockWidget, SIGNAL(visibilityChanged(bool)), // connect(m_panel->treeDockWidget, SIGNAL(visibilityChanged(bool)),
this, SLOT(visibilityChangedForTreePanel(bool))); // this, SLOT(visibilityChangedForTreePanel(bool)));
// connect(m_panel->bottomDockWidget, SIGNAL(topLevelChanged(bool)),
// this, SLOT(topLevelChangedForBottomPanel(bool)));
fd = new findDialog(this, this); fd = new findDialog(this, this);
fd->hide(); fd->hide();
@@ -1038,11 +1035,18 @@ void ProjectPanel::showEvent(QShowEvent *ev)
if (fwbdebug) qDebug() << "ProjectPanel::showEvent " << this if (fwbdebug) qDebug() << "ProjectPanel::showEvent " << this
<< "title " << mdiWindow->windowTitle(); << "title " << mdiWindow->windowTitle();
connect(m_panel->treeDockWidget, SIGNAL(topLevelChanged(bool)),
this, SLOT(topLevelChangedForTreePanel(bool)));
connect(m_panel->treeDockWidget, SIGNAL(visibilityChanged(bool)),
this, SLOT(visibilityChangedForTreePanel(bool)));
m_panel->treeDockWidget->raise(); m_panel->treeDockWidget->raise();
QWidget::showEvent(ev); QWidget::showEvent(ev);
// we get this event when subsindow is maximized or restored // we get this event when MDI window is maximized or restored
loadState(); loadState();
visibilityChangedForTreePanel(true);
} }
void ProjectPanel::hideEvent(QHideEvent *ev) void ProjectPanel::hideEvent(QHideEvent *ev)
@@ -1050,6 +1054,11 @@ void ProjectPanel::hideEvent(QHideEvent *ev)
if (fwbdebug) qDebug() << "ProjectPanel::hideEvent " << this if (fwbdebug) qDebug() << "ProjectPanel::hideEvent " << this
<< "title " << mdiWindow->windowTitle(); << "title " << mdiWindow->windowTitle();
disconnect(m_panel->treeDockWidget, SIGNAL(topLevelChanged(bool)),
this, SLOT(topLevelChangedForTreePanel(bool)));
disconnect(m_panel->treeDockWidget, SIGNAL(visibilityChanged(bool)),
this, SLOT(visibilityChangedForTreePanel(bool)));
QWidget::hideEvent(ev); QWidget::hideEvent(ev);
} }