Maybe this will help:
void MainWindow::restoreWindow()
{
setVisible(true);
if(isMinimized())
setWindowState(windowState() & ~Qt::WindowMinimized);
#ifdef Q_OS_WIN32
::SetForegroundWindow(effectiveWinId());
::SetWindowPos(effectiveWinId(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
#else
activateWindow();
#endif
}
void MainWindow::restoreWindow()
{
setVisible(true);
if(isMinimized())
setWindowState(windowState() & ~Qt::WindowMinimized);
#ifdef Q_OS_WIN32
::SetForegroundWindow(effectiveWinId());
::SetWindowPos(effectiveWinId(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
#else
activateWindow();
#endif
}
To copy to clipboard, switch view to plain text mode
Bookmarks