Home > Back-end >  How to run new instance of qt application programmatically
How to run new instance of qt application programmatically

Time:06-26

Im trying to clone notepad. Im getting some trouble with the "new window"(ctrl shift n) button. is there a way for me to run a new instance of the application programmatically?(that is also not a child of the first instance, meaning if i close the first instance the second instance will continue to live)

(I already read about the fact that you cant call main from inside ur program so thats -1 idea)

Qt6 Windows 11

CodePudding user response:

I think https://doc.qt.io/qt-6/qprocess.html is what you are looking for. Expecially the startDetached method might do the trick, see: https://doc.qt.io/qt-6/qprocess.html#startDetached-1

  •  Tags:  
  • c qt
  • Related