[Qt-interest] Maintaining a map of QProcesses
Sean Harmer
sean.harmer at maps-technology.com
Tue Nov 24 14:41:51 CET 2009
Hi,
On Tuesday 24 November 2009 10:50:27 Wm. G. Urquhart wrote:
> Hi,
>
> I have an application that I want to use to launch other processes from
> based on the user's actions. These processes will be an instance of the
> same application but with different parameters passed to them. For
> example "Notepad.exe" "text1.txt" and "Notepad.exe" "text2.txt".
>
> At present I'm keeping the * of the process in a map along with an ID as
> the key but ideally, what I'd like to be able to do is when any of the
> processes state changes I would like to be notified of this so I can
> clean up my UI and perform housekeeping on the map. I know there is a
> stateChange slot but how to tie this all together and knowing which
> process raised it is where I'm confused.
>
> I'd really appreciate your thoughts on this.
>
Can you not just use the sender() function in the slot to get a pointer to the
object that emitted the stateChanged() signal?
Another alternative is to use QSignalMapper.
http://doc.trolltech.com/4.6-snapshot/qsignalmapper.html
HTH,
Sean
More information about the Qt-interest-old
mailing list