You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, March 11th 2008, 2:34pm

Problem

Can I emit 2 signals simultaneosly ???
If Yes
1) how?
2) will both signals work in a parallel manner?

2

Wednesday, March 12th 2008, 3:08am

RE: Problem

Yes, I suspect you can do it by usting emit twice. And I think that your signals will be processed sequentially. But what functionality you need? Maybe there is another simpler solution?

3

Wednesday, March 12th 2008, 5:28am

RE: Problem

emit ok
emit done

the first emit will return from all its slots then done happens,
I am right with this ,
If yes then how can I emit two signals so that the work in a parallel manner

mercodus

Trainee

  • "mercodus" is male

Posts: 60

Location: North Wales, UK

Occupation: Software developer

  • Send private message

4

Wednesday, March 12th 2008, 1:48pm

You don't say which version you are using. The situation seems to be slightly different between release 3 and 4.


From the Qt website;

4.3
"When a signal is emitted, the slots connected to it are usually executed immediately, just like a normal function call. When this happens, the signals and slots mechanism is totally independent of any GUI event loop. Execution of the code following the emit statement will occur once all slots have returned. The situation is slightly different when using queued connections; in such a case, the code following the emit keyword will continue immediately, and the slots will be executed later.

If several slots are connected to one signal, the slots will be executed one after the other, in an arbitrary order, when the signal is emitted."

3.3
"When a signal is emitted, the slots connected to it are executed immediately, just like a normal function call. The signal/slot mechanism is totally independent of any GUI event loop. The emit will return when all slots have returned."

5

Thursday, March 13th 2008, 1:49am

I think that if you want to run them in paralel you need to create multithreaded application, and put your connected slots in different threads.