argument errors withQComboBox.currentTextChanged signal

Axel Rau Axel.Rau at Chaos1.DE
Mon Jul 12 12:50:52 BST 2021


Hi all,

if I have:

@QtCore.pyqtSlot(str)
def zoneBoxSelectionChanged(self, zone_name):
    self.reload_table(zone_name)

def connect_signals(self):
    self.zoneBox.currentTextChanged.connect(self.zoneBoxSelectionChanged(str))

I get:

self.zoneBox.currentTextChanged.connect(self.zoneBoxSelectionChanged(str))
TypeError: argument 1 has unexpected type ‚NoneType'


if I have:

@QtCore.pyqtSlot(str)
def zoneBoxSelectionChanged(self, zone_name):
    self.reload_table(zone_name)

def connect_signals(self):
    self.zoneBox.currentTextChanged.connect(self.zoneBoxSelectionChanged())

I get:

self.zoneBox.currentTextChanged.connect(self.zoneBoxSelectionChanged())
TypeError: zoneBoxSelectionChanged() missing 1 required positional argument: ‚zone_name'

What am I doing wrong?

Thanks Axel
---
PGP-Key: CDE74120  ☀  computing @ chaos claudius

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210712/12459a39/attachment.sig>


More information about the PyQt mailing list