How to manage separate GUI processes in a Qt application?

心不动则不痛 提交于 2021-02-11 12:23:38

问题


How would a Qt GUI application start separate GUI applications in different processes and managed their windows?

Let's say I have a Qt application call myApp. The user is able to launch external application available on the OS from within myApp that run in their own separate process. I know about QProcess, but the difficult part that I haven't been able to figure out is managing the windows. myApp will need to have it's own title bars for windows and also be cross platform. If I launch an application, say the calculator on Windows, how do I get rid of the OS title bar and window frame with OS default one, and then how do I manage the position and geometry of that window?

more details: The idea is to be able to extend myApp, including by 3rd parties, by adding new services that are implemented in any language and any GUI toolkit. Also, if a service crashes, it shouldn't affect myApp or other services. To use an analogy, imagine if in Visual Studio the editor was implemented in C and its GUI in GTK, the debuger in C++ and its interface in Qt, etc, and everything looked one piece.


回答1:


From whatever I got from you question and from whatever Qt I know, Qt does not support to handle other application(like changing position). So you will have to handle applications on different platform differently. i.e. if your myApp is in windows and you run calculator program. Then you can use winApis to handle the calculator app like you can use SetWindowPos to set its pos, etc.



来源:https://stackoverflow.com/questions/30928063/how-to-manage-separate-gui-processes-in-a-qt-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!