Aetion
Aetion

Reputation: 13

Python (Pyside) connect() arguments syntax

I am new to PySide and Python in general. I came across this following function in the PySide docs:

Signal.connect(receiver[, type=Qt.AutoConnection])

Can anyone explain to me what the function/argument part above means ?

Upvotes: 1

Views: 663

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1121266

It is documenting that the type keyword argument to the Signal.connect() method is optional. When type is omitted, it defaults to Qt.AutoConnection.

The receiver positional argument is required.

You can use any callable for the reciever; it'll simply be called with no arguments in that case. You may want to decorate the callable with the Slot decorator.

PySide Slot objects are direct analogies of the PyQT New-style Signal and Slot Support.

Upvotes: 1

Related Questions