Bring window to front -> raise(),show(),activateWindow() don’t work

前端 未结 5 1725
南方客
南方客 2020-12-06 04:43

In my Qt-application I open a URL in the default-browser. Afterwards I want to bring the main-window of my application to the front again.

I tried all approaches I c

5条回答
  •  广开言路
    2020-12-06 05:12

    I did it like this:

    {
     this->show(); // Restore from systray
     this->setWindowState(Qt::WindowState::WindowActive); // Bring window to foreground
    }
    

    assuming "this" is your QMainWindow. Worked like a charm.

提交回复
热议问题