diff --git a/tests/signal_slot.py b/tests/signal_slot.py index 2a5f123..98cda22 100644 --- a/tests/signal_slot.py +++ b/tests/signal_slot.py @@ -1,6 +1,6 @@ import typing -from PySide2.QtCore import Signal, QObject +from PySide2.QtCore import Signal, QObject, SIGNAL class SomeClassWithSignal(QObject): @@ -10,6 +10,7 @@ class SomeClassWithSignal(QObject): def __init__(self) -> None: super().__init__() # note: this is mandatory for mypy to pickup the class attribute access + self.connect(self,SIGNAL('clicked()'),self.my_slot_no_arg) def my_slot_no_arg(self) -> None: pass diff --git a/tests/slotInsideClass.py b/tests/slotInsideClass.py new file mode 100644 index 0000000..fcb3ae9 --- /dev/null +++ b/tests/slotInsideClass.py @@ -0,0 +1,7 @@ +from PySide2.QtCore import Slot, QObject + +class SomeClass(QObject): + + @Slot(str) + def someMethod(self, stra): + ...