<div dir="ltr"><div><br></div><div>Digging a bit more...</div><div>Sorry, I mixed things.</div><div>Signals indeed do not have Python docstrings but there is a structure containing the documentation that is written under %Docstring in the SIP file.</div><div><br></div><div>So all in all, my question can be resumed as, is there a way in Sphinx to display this signature?</div></div><br><div class="gmail_quote"><div dir="ltr">Le lun. 26 févr. 2018 à 13:23, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Phil,<div><br></div><div>I've been looking a bit more, and it seems signals do have docstring.</div><div>At least I set them in my code and Sphinx seems to pick them up:</div><div><br></div><div>See SIP code:</div><div><a href="https://github.com/qgis/QGIS/blob/master/python/gui/qgsmapcanvas.sip.in#L912-L917" target="_blank">https://github.com/qgis/QGIS/blob/master/python/gui/qgsmapcanvas.sip.in#L912-L917</a></div><div><br></div><div>Resulting doc:</div><div><a href="http://python.qgis.org/api/gui/Map/QgsMapCanvas.html#qgis.gui.QgsMapCanvas.currentLayerChanged" target="_blank">http://python.qgis.org/api/gui/Map/QgsMapCanvas.html#qgis.gui.QgsMapCanvas.currentLayerChanged</a></div><div><br></div><div>Is this expected to you?</div><div><br></div><div>If yes, would there be a way to add the signature in the Docstring? Shall we modify the sip gen to achieve this?</div><div>In Python, doing QgsMapCanvas.currentLayerChanged returns:</div>






<p class="m_1349013259938773309inbox-inbox-p1"><span class="m_1349013259938773309inbox-inbox-s1"><unbound PYQT_SIGNAL currentLayerChanged(QgsMapLayer*)></span></p><p class="m_1349013259938773309inbox-inbox-p1">Cheers,</p><p class="m_1349013259938773309inbox-inbox-p1">Denis</p></div><div dir="ltr"><div><br><div class="gmail_quote"><div dir="ltr">Le mar. 20 févr. 2018 à 08:27, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20 Feb 2018, at 12:13 pm, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>> wrote:<br>
><br>
> Hi Phil,<br>
><br>
> Another issue for Docstrings...<br>
> Would it be possible to get a signature for signals too?<br>
> They are listed as attribute (and not method in sphinx).<br>
<br>
Signals *are* attributes and attributes cannot have docstrings.<br>
<br>
Phil<br>
</blockquote></div></div></div></blockquote></div>