PDA

View Full Version : how can I get the QApplication handle by process ID in QT2



pencilren
25th August 2007, 03:22
I want to get main window handle by process id, So first I must get the QApp handle, what can I do?

jacek
26th August 2007, 18:42
What operating system do you use?

pencilren
27th August 2007, 05:39
linux, do you have some idea?

jacek
27th August 2007, 22:17
linux, do you have some idea?
Well, it's not that easy. You can't simply access some object in another process. It would have to be allocated in shared memory segment, that you can map. Better try some IPC mechanism, like DBUS.

sunil.thaha
28th August 2007, 08:11
I am wondering how the Test tools like squish does it ?

jacek
28th August 2007, 20:10
I am wondering how the Test tools like squish does it ?
I've never had a chance to use Squish, but I think it might use LD_PRELOAD to inject a library that intercepts calls to Qt. Other possibility is to attach to the application like a debugger. Anyway these aren't normal ways of interprocess communication.