C++ (Qt)void MainWindow::setVisible( bool set ){ if( set ) setAttribute( Qt::WA_DontShowOnScreen, true ); restoreGeometry( g ); restoreState( s ) QWidget::setVisible( set ); if( set && testAttribute( Qt::WA_DontShowOnScreen ) ) { setAttribute( Qt::WA_DontShowOnScreen, false ); setAttribute( Qt::WA_WState_ExplicitShowHide, false ); QTimer::singleShot( 5, this, SLOT( show() ) ); }}