+ fix changing 3d view when switching from Complete workbench to any other workbench

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5335 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer 2011-12-21 17:14:04 +00:00
parent d388f35fd0
commit 791aca3c2c

View File

@ -232,6 +232,16 @@ void ToolBarManager::setup(ToolBarItem* toolBarItems)
// hide all unneeded toolbars
for (QList<QToolBar*>::Iterator it = toolbars.begin(); it != toolbars.end(); ++it) {
// make sure that the main window has the focus when hiding the toolbar with
// the combo box inside
QWidget *fw = QApplication::focusWidget();
while (fw && !fw->isWindow()) {
if (fw == *it) {
getMainWindow()->setFocus();
break;
}
fw = fw->parentWidget();
}
// ignore toolbars which do not belong to the previously active workbench
QByteArray toolbarName = (*it)->objectName().toUtf8();
if (!(*it)->toggleViewAction()->isVisible())