CopperSpice API  1.7.4
Signals and Slots Edit Mode

The Signal/Slot Editor is used to establish connections between objects. When one object is changed another object can be updated. Widgets are connected by specifying the Sender and Receiver objects, the Signal method located in the Sender class, and the appropriate Slot method in the Receive class.

For more information on this mechanism, refer to the Signals and Slots documentation.

Creating Connections

There are multiple ways to set up the Signal/Slot connections. Our suggestion is to call the connect() method in your application rather than setting this up in the Designer. If you prefer to use the Designer there are two ways to proceed. The connections can be made by using the drag and drop approach or from the Signal/Slot Editor.

Creating Connections - Drag and Drop Approach

To connect objects in Designer select the Signal/Slot Editor by opening the Edit menu and selecting Edit Signals/Slots or by pressing the F4 key. Any existing connections will be shown on top of the form with arrows indicating the Sender and Receiver widgets.

When the cursor is hovering over a widget or control which can be used in a connection the object will be highlighted in red. To make a connection, press the left mouse button and drag the cursor towards the Receiver object. A line will be drawn from the Sender to the Receiver. Release the mouse button to make the connection.

The Configure Connection dialog will automatically appear. In this dialog select the Signal and Slot methods for the connection. If the check box is selected, then all available signals from the source object will be shown. If the check box is not selected, then any signal or slot methods declared in QWidget will be hidden.

You can abandon the connection at any point while dragging the connection path by pressing Esc.

Deleting a Connection
A connection can be deleted by clicking on any of the path segments. Once selected press the Delete key.
Connecting to a Form
To make a connection from a widget or control to the form, click on the widget and then drag the cursor over the background of the form before releasing the mouse button. The end point of the connection will change to a large down arrow.

Creating Connections - Signal/Slot Editor Approach

From the Signal/Slot Editor click on the plus icon to add a new connection. Then use the drop down boxes to pick the Sender, Signal, Receiver, and Slot. To remove a connection click the minus icon.