<div dir="ltr">> Date: Thu, 14 Aug 2014 08:45:07 +0100<br>> From: Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>><br>> Subject: Re: [PyQt] adding signal from class method?<br>
><br>><br>> C++ isn't as dynamic as Python. The QMetaObject (which contains the<br>> signal definitions) is created when the class is defined and cannot be<br>> modified later.<br><br><br>Suggest adding words to clarify this restriction under the topic "Defining New Signals with pyQtSignal()" at <a href="http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html">http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html</a>.<br>
<br>The syntax of defining a signal is that of assignment to a class
variable. This tempts the user to think of it as a run-time action, not a
declarative statement, and to suppose one could change or add signals
at run-time too -- which Python's dynamic nature permits for other class
attributes.<br><br>While the doc already says "New signals defined in this way will be automatically added to the class’s QMetaObject.This means that they will appear in Qt Designer and can be introspected using the QMetaObject API", strongly suggesting their static nature, it isn't definitive.<br>
<br>This could be prefixed with something like "The pyQtSignal syntax is processed only during execution of the class statement (signals cannot be defined or redefined outside the class statement). New signals defined in this way..."<br>
</div>