<p dir="ltr">If the slot weren't in the QMetaObject, how would the object method get called (it does get called)? Also do you mean inspecting via Python (i.e. with print or debugger) or do you mean at the c++ level (attaching to process with VS)? </p>
<br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 25, 2016, 07:59 Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 25 Aug 2016, at 12:48 pm, oliver <<a href="mailto:oliver.schoenborn@gmail.com" target="_blank">oliver.schoenborn@gmail.com</a>> wrote:<br>
><br>
> I read recently in an exchange between Florian and Phil that:<br>
><br>
> The main purpose of pyqtSlot is to define a new entry in the QObject's QMetaObject, so you would normally only use it on a method. pyqtSlot doesn't check that the containing class is a QObject because it might be being used as a mixin. When the connection is made the receiver must be a QObject.<br>
><br>
><br>
> In our code, we wrap slots so that we can customize error handling, so in a couple places we have code like this:<br>
><br>
><br>
> def slot_fixer(qobject_method):<br>
><br>
>     def slot_wrapper():<br>
><br>
>          ...do stuff...<br>
><br>
>          qobject_method()<br>
><br>
>     return pyqtSlot()(slot_wrapper)<br>
><br>
><br>
> class Foo(QObject):<br>
><br>
>     def qobject_method(self):<br>
><br>
>         ....<br>
><br>
><br>
>     slot_qobject_method = slot_fixer(qobject_method)<br>
><br>
><br>
> I.e., the method wrapped is from a QObject-derived class, but what pyqtSlot "decorates" is a wrapper for this method. This seems to have been working fine in PyQt 5.3 and 5.5, were we just lucky? Is it safe in 5.7?<br>
<br>
Inspect the QMetaObject to see if the slot is there as you would expect.<br>
<br>
Phil<br>
<br>
</blockquote></div>