-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please add support for indexing pyqtSignal Objects. #9
Comments
Was this implemented? I still see pyqtSignals as not indexable class CoolClass(QObject):
signal = pyqtSignal([int], [str])
def __init__(self) -> None:
super().__init__()
self.signal[int].connect(lambda val: print(val))
self.signal[str].connect(lambda val: print(val[::-1]))
instance = CoolClass()
instance.signal[int].emit(5)
instance.signal[str].emit("five")
|
No this has not been implemented, yet. I closed it because it was an old issue. As it is not a feature I am using I must admit that I didn't have a close look at it. But did so now. I think that's definetly a thing we could do. |
@BryceBeagle would you like to take care of it? |
I just added |
Hi, I moved away from the original project that required this and @Aulla is on it at the moment. Maybe he can comment here. For now, I'll just close this. |
https://github.com/stlehmann/PyQt5-stubs/blob/189a0497d08ddd65f46e4819f427eb2d03196589/PyQt5-stubs/QtCore.pyi#L31
See this link:
https://stackoverflow.com/questions/45337136/qsignalmapper-in-pyqt5-not-working-when-the-function-argument-is-a-str
We're expected to do: "mapper.mapped[str].connect(a_function)" in order to retrieve the overload we want for the signal.
It should be enough if we add getitem returning pyqtSignal.
The text was updated successfully, but these errors were encountered: