Details
-
Suggestion
-
Resolution: Done
-
P4: Low
-
None
-
6.3.0
-
None
-
bdfb36b880 (pyside/pyside-setup/dev) a7ec89fc56 (pyside/pyside-setup/6.3) 77e159e931 (pyside/pyside-setup/6.2) 77e159e931 (pyside/tqtc-pyside-setup/6.2) a7ec89fc56 (pyside/tqtc-pyside-setup/6.3) bdfb36b880 (pyside/tqtc-pyside-setup/dev)
Description
The repr() of signals makes it impossible to see what signal we are dealing with:
>>> from PySide6.QtCore import QTimer
>>> QTimer.timeout
<PySide6.QtCore.Signal object at 0x7fcd97b2abf0>
>>> QTimer().timeout
<PySide6.QtCore.SignalInstance object at 0x7fcd9bc37510>
compare this to PyQt6:
>>> from PyQt6.QtCore import QTimer
>>> QTimer.timeout
<unbound PYQT_SIGNAL timeout()>
>>> QTimer().timeout
<bound PYQT_SIGNAL timeout of function object at 0x7fa19b886440>
{code)
This is useful for a variety of debugging scenarios, and would also be needed in pytest-qt so that the user doesn't have to pass both signals and their names (as string) to get usable debug output.
Ideally, the name would be part of the repr() but also accessible via a .name attribute or so.
Attachments
For Gerrit Dashboard: PYSIDE-1911 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
408949,3 | libpyside: Add a __repr__ for PySideSignalInstance | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
409062,2 | libpyside: Add a __repr__ for PySideSignalInstance | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
409063,2 | libpyside: Add a __repr__ for PySideSignalInstance | 6.2 | pyside/pyside-setup | Status: MERGED | +2 | 0 |