Project

General

Profile

Signals and slots » History » Version 9

Version 8 (Ohlsson, Staffan, 15/02/2012 03:59 PM) → Version 9/11 (Ohlsson, Staffan, 15/02/2012 04:00 PM)

{{toc}}


h1. Signals and slots

The Framework uses a _signals_ and _slots_ mechanism, similar to the one used by Qt, for communication between [[Info_Bricks|Bricks]] and [[Control_Objects|Control Objects]].

Each Brick or Control Object can have several signals, which can be emitted, and slots, corresponding to methods which are exposed to the framework.

The framework ensures that a Brick and a Control Object signals and slots match when creating a GUI.

h2. Matching signals and slots between Bricks and Control Objects

Each *Brick* has one or more *connection definitions*

Example:
<pre>
connections = {"command_executor": Connection("Command Executor",
[],
[ Slot("get_vars"), Slot("do_it") ],
"executor_connected")}
</pre>
Here there are no Signals and 2 Slots

Each *Control Object* declares which signals and slots it has.

Example of Control Object corresponding to the Brick above:
<pre>
signals = []
...
slots = [ Slot('get_vars'), Slot('do_it') ]
</pre>

h3. A more complicated matching