Important: Please read the Qt Code of Conduct -

[PySide]How to emit a multi-arguments signal.

  • Dear community,

    I got a TypeError: findPrevious(QString) only accepts 1 arguments, 3 given!

    but, I want to emit a multi-arguments signal.
    How can I do it?

    @class FindDialog(QtGui.QDialog):
    findPrevious = QtCore.Signal(str, QtCore.Qt.CaseSensitive)
    findNext = QtCore.Signal(str, QtCore.Qt.CaseSensitive)

    def findClicked(self):
    text = self.lineEdit.text()
    if self.caseCheckBox.isChecked:
    cs = QtCore.Qt.CaseSensitive
    cs = QtCore.Qt.CaseInsensitive
    if self.backwardCheckBox.isChecked:
    self.findPrevious.emit(text, cs)
    self.findNext.emit(text, cs)

  • what function?

  • This one.

    @self.findPrevious.emit(text, cs)@

    But, I think signal can not emit multi-arguments in PySide.

    However, C++ can it.

    @emit findPrevious(text, cs);@

Log in to reply