Skip to content
QtWS25 Last Chance
  • 0 Votes
    3 Posts
    398 Views
    M
    @SGaist said in Re-activate (known as create a new substance) a QMainWindow after the last QMainWindow is closed: Based on this feature request, you should be able to react on the ˋQEvent::ApplicationActivate`. I'm using that in a subclass of QApplication. The idea in pseudo code: void Application::applicationStateChanged ( Qt::ApplicationState state) { if(state==Qt::ApplicationActive AND no window is open AND OpenUntitledWindow ) { openNewWindow(); } OpenUntitledWindow is a flag setting if an new window/document should be opened on startup, it works also when the app is reactivated with the code above.