PDA

View Full Version : QProcess, how to give focus to the new process on Mac



simlab
24th January 2010, 05:19
My application on Mac starts another process using QProcess.
The new application started using QProcess is hidden behind the original application.

The problem is that I do not have the code for the application which I start using QProcess, so I need to give it access from my Qt based application.

I will truly appreciate the help,

Ashraf Sultan
Simulation Lab Software
www.simlab-soft.com

wysota
24th January 2010, 10:36
By "giving access" you mean to activate its window and bring it to front? There is no simple way to do this. It would be probably easiest if you just minimized the window of your application but there is no guarantee there won't be other windows obscuring the one you want.

simlab
24th January 2010, 22:24
Thank you for the suggestion. I will try it.

I was hoping that Mac has a C/C++ function which gives the focus to a process based on its process ID.
QProcess already returns PID.

wysota
25th January 2010, 00:27
It probably has such a function somewhere. But that's certainly not a simple solution.