User Tools

Site Tools


qt:signals_and_slots

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
qt:signals_and_slots [2010/12/09 15:13] – [Making connections] mithatqt:signals_and_slots [2011/04/01 11:09] mithat
Line 6: Line 6:
 A connection between a signal and a slot is made as follows: A connection between a signal and a slot is made as follows:
 <code cpp-qt> <code cpp-qt>
-QObject::connect({pointer to emiter}, SIGNAL({signal-name}({parameter-type(s)})), +QObject::connect(<pointer to emiter>, SIGNAL(<signal-name>(<parameter-type(s)>)), 
-                 {pointer to receiver}, SLOT({slot-name}({parameter-type(s)})));+                 <pointer to receiver>, SLOT(<slot-name>(<parameter-type(s)>)));
 </code> </code>
  
-The emiter emits the signal ''{signal-name}'' with a list of values whose types are identified with ''{parameter-types(s)}''. The receiver receives this signal into its ''{slot-name}'' slot along with the values emitted with the signal. The slot then takes the appropriate action depending on the value of the passed parameters. +The emiter emits the signal ''<signal-name>'' with a list of values whose types are identified with ''<parameter-types(s)>''. The receiver receives this signal into its ''<slot-name>'' slot along with the values emitted with the signal. The slot then takes the appropriate action depending on the value of the passed parameters. 
  
 Example:((From Molkentin, p. 37)) Example:((From Molkentin, p. 37))
Line 34: Line 34:
 Signals may connect to multiple slots. Multiple signals may also connect to a single slot. Signals may connect to multiple slots. Multiple signals may also connect to a single slot.
  
-In the case of multiple connection, the execution order of the slots or signals is undefined.+In the case of multiple connections, the execution order of the slots or signals is undefined.
  
 ===== Writing your own slots ===== ===== Writing your own slots =====
qt/signals_and_slots.txt · Last modified: 2011/04/01 11:10 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki