\internal
*/
const char* DEFAULT_SECTION = "SalomePyQt";
+
+ struct Activator
+ {
+ QWidget* myActiveWindow;
+ QWidget* myFocusedWidget;
+ Activator()
+ {
+ myActiveWindow = QApplication::activeWindow();
+ myFocusedWidget = QApplication::focusWidget();
+ QApplication::setActiveWindow( getApplication()->desktop() );
+ }
+ ~Activator()
+ {
+ if ( myActiveWindow )
+ QApplication::setActiveWindow( myActiveWindow );
+ if ( myFocusedWidget )
+ myFocusedWidget->setFocus();
+ }
+ };
}
/*!
virtual void Execute()
{
if ( LightApp_Application* anApp = getApplication() ) {
+ Activator activator;
myResult = anApp->activateModule( myModuleName );
}
}
SUIT_ViewWindow* wnd = getWnd( myWndId );
MESSAGE("window id:" << myWndId << " SUIT_ViewWindow*: " << wnd);
if ( wnd ) {
+ Activator activator;
wnd->setFocus();
myResult = true;
}