Search code examples
pythonpython-3.xpyside2

Pyside2.QtCore no Signal Class since version 5.12.4


Since version 5.12.3 of Pyside2 QtCore does no longer have a Signal Class. Although the official documentation still says that Signal() and Slot() is the new Style of using signal and slots with Pyside2.

https://wiki.qt.io/Qt_for_Python_Signals_and_Slots#New_syntax:_Signal.28.29_and_Slot.28.29

That´s how I used the Signal class in my projects until the version:

# --------------------------------------- #
#               imports                   #
# --------------------------------------- #
from PySide2.QtCore import Signal

# --------------------------------------- #
#               classes                   #
# --------------------------------------- #
class MainWindow(QMainWindow):
    UPDATE_THREAD_TIMEOUT_IN_S = 30
    show_systray_msg = Signal(str, QIcon)
    new_frame_added = Signal()
    show_frames = Signal()
    show_kibana = Signal()

    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

But that´s no longer working.

Does anybody know if that´s a bug or am I missing any information on how to use the Signal?


Solution

  • It is not missing! The import in PyCharm just did not show correctly and threw a warning but everything works.