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.