From: vsv Date: Tue, 13 May 2014 15:46:23 +0000 (+0400) Subject: Fix for frozen toolbar after window activation. X-Git-Tag: V_0.2~68 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e0df78314b8cf61f836518215b5e46509713d30a;p=modules%2Fshaper.git Fix for frozen toolbar after window activation. --- diff --git a/src/XGUI/XGUI_MainWindow.cpp b/src/XGUI/XGUI_MainWindow.cpp index a0cefc1d3..4b8c9e091 100644 --- a/src/XGUI/XGUI_MainWindow.cpp +++ b/src/XGUI/XGUI_MainWindow.cpp @@ -13,6 +13,7 @@ #include #include #include +#include XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) : QMainWindow(parent), @@ -171,15 +172,18 @@ void XGUI_MainWindow::activateView() QMdiArea* aMdiArea = static_cast(centralWidget()); QList aWndList = aMdiArea->subWindowList(); + QMdiSubWindow* aTargetView = 0; foreach(QMdiSubWindow* aWnd, aWndList) { if (aWnd->windowTitle() == aWndTitle) { aWnd->raise(); aWnd->activateWindow(); - aWnd->setFocus(); + aTargetView = aWnd; break; } } QApplication::processEvents(); + if (aTargetView) + QTimer::singleShot(20, aTargetView, SLOT(setFocus())); } void XGUI_MainWindow::onViewActivated(QMdiSubWindow* theSubWnd)