how can i toggle two Qt applications on a single window
I am running a application(application No.1) on a touch screen by using Qt4.6.3 in Linux os. When i click a button in a开发者_运维问答pplication No.1, the new application(application No.2) should be popped up. The application No.2 should contain close and minimize buttons. When i click minimize button, it should be minimized and then i click a button in application No.1, the application No.2 should again be popped up. That is, two applications should be in toggle state. How can i acheive this? Please help me. Thanks in Advance.
Since you are working on Linux the most portable and convenient way in my opinion would be setting up some kind of inter process communication (socket communication for instance) between these two processes. If you were working on Windows, you could have used "FindWindow" or a similar OS provided API to find the other process' window but on linux you are dependent on window manager.
When the other processes receives the message, you need to bring it to foreground. You can use QWidget::activateWindow to grab keyboard focus or QWidget::raise if you want to ensure that the window is stacked on top as well.
Read the Qt documentation for method information.
精彩评论