Important: Please read the Qt Code of Conduct -

PyQt4 Signal to PyQt5 Signal Convert?

  • self.emit(SIGNAL("selectedInfoChanged(int, QString, int, QString)"), packages, packagesSize, extraPackages, extraPackagesSize)
    self.emit(SIGNAL("selectedInfoChanged(QString)"), unicode(e))

    pyqt5 also how I do it? Sorry, my English is weak.

  • selectedInfoChanged = pyqtSignal() # ???

    Unclear how many will take the argument?

  • If you are trying to emit the signal selectedInfoChanged then you would do as follows:

    self.selectedInfoChanged.emit(packages, packagesSize, extraPackages, extraPackagesSize)

    If you are trying to declare a signal with that signature then you would do the following:

    class MyClass(QObject):
        selectedInfoChanged=pyqtSignal(int, str, int, str)

    Note: a signal must be a class attribute not an instance attribute and QString is not supported by PyQt5, just use python strings (PyQt5 automatically converts them to C++ QStrings).

    Hope this helps ;-)

Log in to reply