<div dir="ltr">I don't know specifically how using QVariant could change the behavior: I'm always using sip api version 2 also with Python 2 and Qt4 for everything, as I find it's much more simpler and usable since it automatically converts python types without using <font face="monospace, monospace">.toPyObject()</font>. Note that, by using sip v2 for everything, QtCore will not wrap QVariant nor QString/QStringList (the latter is the default for Py3). You can specify the C++ signature type using quotes, though, such as pyqtSignal(['QString', 'QVariant']), which can be useful where you don't have full control over the slots, like in designer plugins.<div><br></div><div>That said, as you might know, "object" is a much broader specification for the object type, meaning that it includes any kind of new-style python subclass ("object", indeed), including any PyQt wrapper. It can be useful when you want to emit signals using complex parameters (such as object references), but, in your case, QVariant should be enough.</div><div><br></div><div>Maurizio</div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-06 9:29 GMT+02:00 J Barchan <span dir="ltr"><<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On 5 September 2018 at 18:38, Maurizio Berti <span dir="ltr"><<a href="mailto:maurizio.berti@gmail.com" target="_blank">maurizio.berti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>First of all, if anyone here has access to the documentation pages of PyQt, please read this (expecially the third point).</div><div><br></div><div><br></div><div dir="ltr">I do not know your exact user case, so it's hard to give you specific suggestions, but here's what I'd do.<div><br></div><div>1. do not give any signature to the signal at all:</div><div><br></div><div><div style="font-size:12.8px;font-family:tahoma,sans-serif"><span style="font-family:monospace,monospace">    notifyProgress = QtCore.pyqtSignal(object, object)</span><br></div></div><br>This allows you to use None for both arguments, but I'm not familiar with typing in methods for python 3 (to be fair, I didn't even know about it until yesterday, as I mainly use Python2). I did a quick test and it seems to work fine, though.</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">2. use a single parameter that will be sent as a tuple, and unpack it within the method:</div><div dir="ltr"><br></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">    notifyProgress = QtCore.pyqtSignal(object)</span><br></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-size:12.8px"><font face="monospace, monospace">def updateProgress(self, *args):</font></span><br></div><div><span style="font-size:12.8px"><font face="monospace, monospace">        val, text = args</font></span></div><div><span style="font-size:12.8px"><font face="monospace, monospace"><br></font></span></div><div><span style="font-size:12.8px"><font face="monospace, monospace">    [...]</font></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">       </span><span style="font-family:monospace,monospace;font-size:12.8px"> self.</span><span style="font-family:monospace,monospace;font-size:12.8px">notifyProgress.emit((No<wbr>ne, "Some text"))</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">        self.</span><span style="font-family:monospace,monospace;font-size:12.8px">notifyProgress.emit((i / 2, None))</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div></div><div dir="ltr">3. use an overloaded signal and two separate slots. This is something I was struggling for a lot of time and (thanks to you! :-D) I finally found out how it works, as it is *not* explained exhaustively in the documentation. Also, I think that's what you were referring to.</div><div dir="ltr">As we know, signals can be connected "in two ways" (I'm referring to new-style connections). Normally, you can go by simply connecting the slot and eventually decorating that slot with the signature you are interested in; decoration is usually not strictly required, as slot that are processing invalid data are somewhat "ignored": I always thought it as some kind of try/except mechanism, if at some point within the method something wrong happens, the error is ignored but no exception is thrown; of course, using a decorated slot avoids unnecessary computation for wrong signature arguments.</div><div dir="ltr">Sometimes, though, it's better if not necessary to connect the slot to the specific signature: <font face="monospace, monospace">self.somesignal[signature].con<wbr>nect(slot)</font>.</div><div dir="ltr">What the documentation forgets to explain is that the same _has_ to be done when emitting custom overloaded signals if you are not using the default signature (the first argument).</div><div dir="ltr"><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">    #in this case, "str" is the default signature</span></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">    notifyProgress = QtCore.pyqtSignal([str], [int])</span><br></div><div dir="ltr"><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">    [...]</span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">        #the default signature can be omitted</span></div><div><span style="font-family:monospace,monospace;font-size:12.8px"></span><span style="font-size:12.8px"><font face="monospace, monospace">        self.notifyProgress.connect(se<wbr>lf.updateProgressString)</font></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">        self.notifyProgress[int].conne<wbr>ct(self.updateProgressInt)</span><span style="font-size:12.8px"><font face="monospace, monospace"><br class="m_1287899784910096018m_-166279091772196246gmail-Apple-interchange-newline">    [...]</font></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><font face="monospace, monospace">@QtCore.pyqtSlot(str)</font><br></div><div dir="ltr"><div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-size:12.8px"><font face="monospace, monospace">def updateProgressString(self, text):</font></span></div></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-size:12.8px"><font face="monospace, monospace">    [...]</font></span></div><div dir="ltr"><span style="font-size:12.8px"><font face="monospace, monospace"><br></font></span></div></div><div dir="ltr"><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><font face="monospace, monospace">@QtCore.pyqtSlot(int)</font></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-size:12.8px"><font face="monospace, monospace">def updateProgressInt(self, val):</font></span></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">    [...]</span><font face="monospace, monospace"><span style="font-size:12.8px"><br></span></font><div><span style="font-family:monospace,monospace"><br></span></div></div><div><span style="font-size:12.8px"><font face="monospace, monospace">    [...]</font></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">        #again, the default signature can be omitted</span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">       </span><span style="font-family:monospace,monospace;font-size:12.8px"> self.</span><span style="font-family:monospace,monospace;font-size:12.8px">notifyProgress.emit("So<wbr>me text")</span><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">        #now, <b>THIS</b>!</span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">       </span><span style="font-family:monospace,monospace;font-size:12.8px"> self.</span><span style="font-family:monospace,monospace;font-size:12.8px">notifyProgress[int].emi<wbr>t(5)</span><br></div><div dir="ltr"><br></div><div>I really think that this is something the documentation should *not* miss. I understand that from the C++ point of view it's pretty obvious that a signal is emitted according to its argument type signature, but this is not that obvious for a common Python programmer.<br></div><div><br></div><div dir="ltr"><div>Obviously, in the last case there's a small drawback: you can't pass None as argument, as it will be converted to the typed signature, giving you an empty string or that infamous random 32bit integer. I don't think it would be an issue in your case, but it is something to keep in mind anyway.</div><div><br></div></div><br>I hope this helps... it helped me :-)<span class="m_1287899784910096018HOEnZb"><font color="#888888"><br><br>Maurizio</font></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="m_1287899784910096018HOEnZb"><div class="m_1287899784910096018h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-09-05 12:33 GMT+02:00 J Barchan <span dir="ltr"><<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><br></div><div class="gmail_extra"><div><div class="m_1287899784910096018m_-166279091772196246h5"><br><div class="gmail_quote">On 5 September 2018 at 09:11, J Barchan <span dir="ltr"><<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><br></div><div class="gmail_extra"><div><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-h5"><br><div class="gmail_quote">On 4 September 2018 at 18:08, Maurizio Berti <span dir="ltr"><<a href="mailto:maurizio.berti@gmail.com" target="_blank">maurizio.berti@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">You are defining a specific signature in the signal:</div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-family:monospace,monospace;font-size:12.8px">QtCore.pyqtSignal(int, str)</span><br></div><br>this means that, despite the types you set in the method (which Qt doesn't know anything of also, as you didn't use the Slot decorator), whenever you emit a None (which is a NoneType, not int, nor str) Qt will try to "translate" it to the valid signature you assigned.</div><div><br></div><div>I don't know exactly why the int is that a high number (always high and always random), but this probably makes sense for some C++ type signature, as it seems to me that the number is always 32bit long and, in my case, always negative.</div><div><br></div><div>Anyway, if you really need to send None, you can use the generic "object" signature in the signal definition, or, in your case, just go with this, assuming the progress will never use negative numbers.</div><div><br></div><div><span style="font-family:monospace,monospace;font-size:12.8px">def updateProgress(self, val: int=-1, text: str=''):</span><br></div><span style="font-family:monospace,monospace;font-size:12.8px">    </span><span style="font-family:monospace,monospace;font-size:12.8px">if val is >= 0:</span><br style="font-family:monospace,monospace;font-size:12.8px"><span style="font-family:monospace,monospace;font-size:12.8px">    </span><span style="font-family:monospace,monospace;font-size:12.8px">    self.progressBar.pb.setValue(</span><span style="font-family:monospace,monospace;font-size:12.8px">v<wbr>al)</span><br style="font-family:monospace,monospace;font-size:12.8px"><span style="font-family:monospace,monospace;font-size:12.8px">    </span><span style="font-family:monospace,monospace;font-size:12.8px">if text:</span><br style="font-family:monospace,monospace;font-size:12.8px"><div><span style="font-family:monospace,monospace;font-size:12.8px">   </span><span style="font-family:monospace,monospace;font-size:12.8px"> </span><span style="font-family:monospace,monospace;font-size:12.8px">    self.progressBar.label.</span><span style="font-family:monospace,monospace;font-size:12.8px">setText<wbr>(text)</span> </div><div dir="ltr"><br></div><div>and then emit the text signal using -1 for val.</div><div dir="ltr"><br></div><div>Maurizio</div><div dir="ltr"><br></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463h5">2018-09-04 18:16 GMT+02:00 J Barchan <span dir="ltr"><<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463h5"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif">PyQt5.7.  I am having trouble `emit()`ing a signal and receiving its arguments correctly.  I have read <a href="http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html" target="_blank">http://pyqt.sourceforge.net/Do<wbr>cs/PyQt5/signals_slots.html</a> carefully.<br></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><b>Declaration</b>:</div><br><div style="font-family:tahoma,sans-serif"><span style="font-family:monospace,monospace">    # class variable for "notifyProgress" signal, for displaying a progressbar<br>    notifyProgress = QtCore.pyqtSignal(int, str)</span><br></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><b>Initialisation</b>:</div><div style="font-family:tahoma,sans-serif"><br></div><div><span style="font-family:monospace,monospace"> self.notifyProgress.connect(se<wbr>lf.updateProgress)</span></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><b>Slot</b>:</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><span style="font-family:monospace,monospace">    def updateProgress(self, val: int, text: str):<br>        # slot for self.notifyProgress<br>        # eprpayrequestfunctions.runEpr(<wbr>) calls this to indicate progress<br>        # if it passes an integer it's the desired value for the progressbar<br>        # if it passes a string it's the desired value for the label<br>        if val is not None:<br>            self.progressBar.pb.setValue(v<wbr>al)<br>        if text is not None:<br>            self.progressBar.label.setText<wbr>(text)</span><br><br></div><div style="font-family:tahoma,sans-serif"><b>Signals</b>:</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><span style="font-family:monospace,monospace">1. notifyProgress.emit(None, "Some text")<br><br>2. notifyProgress.emit(i / 2, None)</span></div><br><div style="font-family:tahoma,sans-serif"><b>Behaviour in slot</b>:<br></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">The problem is the passing of <span style="font-family:monospace,monospace">None</span> from <span style="font-family:monospace,monospace">emit()</span>:</div><div style="font-family:tahoma,sans-serif"><br></div>1. <span style="font-family:monospace,monospace">val</span> arrives in slot as <span style="font-family:monospace,monospace">1261196128</span>.<div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><div>2. <span style="font-family:monospace,monospace">text</span> arrives in slot as <span style="font-family:monospace,monospace">''</span> (empty string).</div><div><br></div><b>Questions</b>:</div><div style="font-family:tahoma,sans-serif"><ul><li>Where is this behaviour for <span style="font-family:monospace,monospace">None</span> as an <span style="font-family:monospace,monospace">emit()</span> parameter documented?</li><li>What is the correct/best way for handling this correctly/easily?<span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463m_-2805916086382413410HOEnZb"><font color="#888888"><br></font></span></li></ul></div></div><span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463m_-2805916086382413410HOEnZb"><font color="#888888"><div dir="ltr"><br>-- <br><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463m_-2805916086382413410m_6813107041399019673gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</div></font></span></div></div></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing<wbr>.com/mailman/listinfo/pyqt</a><span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463m_-2805916086382413410gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>
</font></span></div>
</blockquote></div><br></div></div><div style="font-family:tahoma,sans-serif">I'm OK with the <span style="font-family:monospace,monospace;font-size:12.8px">val: int=-1</span>, but not with the <span style="font-family:monospace,monospace;font-size:12.8px">text: str=''</span>.  An <span style="font-family:monospace,monospace">int</span> of <span style="font-family:monospace,monospace">-1</span> is happily an invalid value for me, butt the trouble is a <span style="font-family:monospace,monospace">str</span> of <span style="font-family:monospace,monospace">''</span> is perfectly legal, and will be used :(</div><span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-"><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(which Qt doesn't know anything of also, as you didn't use the Slot decorator),<br></blockquote></div><div style="font-family:tahoma,sans-serif"><br></div></span><div style="font-family:tahoma,sans-serif">I don't mind adding a slot decorator if that would help.  But presumably it would not here, as you're saying my <span style="font-family:monospace,monospace">None</span> value does not match the type correctly anyway, right?</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">I did consider making it so there is only one parameter, and the type (<span style="font-family:monospace,monospace">int</span> or <span style="font-family:monospace,monospace">str</span>) indicates which of the two paths to follow in the slot.  I followed  <a href="http://pyqt.sourceforge.net/Docs/PyQt5/signals_slots.html" target="_blank">http://pyqt.sourceforge.net/Do<wbr>cs/PyQt5/signals_slots.html</a> carefully where it describes"The following code demonstrates the connection of overloaded signals:" but I couldn't get it to work: it <i>always</i> called the first/default overload, regardless of the parameter type ... :(</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">I'm now thinking: could I cut my losses and pass (and receive?) a single parameter as an explicit <span style="font-family:monospace,monospace">QVariant</span> (which we don't usually use from PyQt), so that a single receiver slot can correctly see the original type --- would that work/be advisable?<span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-HOEnZb"><font color="#888888"><br></font></span></div><span class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-HOEnZb"><font color="#888888"><br clear="all"><br>-- <br><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail-m_1169979402024537463gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div></div><div style="font-family:tahoma,sans-serif">OK, I gave <span style="font-family:monospace,monospace">QVariant</span> (single parameter) a try.  <i>All</i> I had to was:</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">1. Declare signal as:</div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif"> <span style="font-family:monospace,monospace">QtCore.pyqtSignal(QVariant)</span></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">2. Write slot like:</div><div style="font-family:tahoma,sans-serif"><br></div><div><span style="font-family:monospace,monospace">def updateProgress(self, val):<br>    if type(val) is int or type(val) is float:<br>        self.progressBar.pb.setValue(v<wbr>al)<br>    elif type(val) is str:<br>        self.progressBar.label.setText<wbr>(val)</span></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">3. And then it works correctly with both emitter types (without caller bothering with <span style="font-family:monospace,monospace">QVariant</span>), like:</div><div style="font-family:tahoma,sans-serif"><br></div><div><span style="font-family:monospace,monospace">notifyProgress.emit(50)<br>notifyProgress.emit("Finishing<wbr>...")</span></div><div style="font-family:tahoma,sans-serif"><br></div><div style="font-family:tahoma,sans-serif">Is there any reason I should <i>not</i> be doing this, because it seems perfect to me?<span class="m_1287899784910096018m_-166279091772196246HOEnZb"><font color="#888888"><br></font></span></div><span class="m_1287899784910096018m_-166279091772196246HOEnZb"><font color="#888888"><div style="font-family:tahoma,sans-serif"><br></div><br clear="all"><br>-- <br><div class="m_1287899784910096018m_-166279091772196246m_-306729045778188742gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</font></span></div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_1287899784910096018m_-166279091772196246gmail_signature" data-smartmail="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>
</div>
</div></div></blockquote></div><br></div></div><div style="font-family:tahoma,sans-serif" class="gmail_default">Hi Maurizio,</div><div style="font-family:tahoma,sans-serif" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">First, thank you for your time on this matter.</div><div style="font-family:tahoma,sans-serif" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">I think the bit you identified which I would not have tried is the (non-documented) need to invoke the non-default overload via </div></div><div class="gmail_extra"><span class=""><div style="font-family:tahoma,sans-serif" class="gmail_default"><div><span style="font-family:monospace,monospace;font-size:12.8px">        #now, <b>THIS</b>!</span></div><div><span style="font-family:monospace,monospace;font-size:12.8px">       </span><span style="font-family:monospace,monospace;font-size:12.8px"> self.</span><span style="font-family:monospace,monospace;font-size:12.8px">notifyProgress[int].emi<wbr>t(5)</span></div></div></span><div style="font-family:tahoma,sans-serif" class="gmail_default">But I would still welcome your comment on my last post?  There I said I have solved the whole thing very simply, just by using</div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div style="font-family:tahoma,sans-serif" class="gmail_default"><span style="font-family:monospace,monospace">QtCore.pyqtSignal(QVariant)</span></div><br></div><div class="gmail_extra"><div style="font-family:tahoma,sans-serif" class="gmail_default">as my signal declaration.  To be clear: although I originally asked for two separate parameters or overloads for the string versus the int, in my case I am quite content with one at a time (calling code tends <i>either</i> to pass the int <i>or</i> the string, it doesn't need both in one call).</div><div style="font-family:tahoma,sans-serif" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">My problem then was the type for the parameter, to cater for either str or int.  I chose <span style="font-family:monospace,monospace">QVariant</span>, and it works fine for me.  Your suggestion seems to be <span style="font-family:monospace,monospace">object</span> (I don't know what that maps to in C++).  Do you think it makes any difference if I stick with my choice?</div><div style="font-family:tahoma,sans-serif" class="gmail_default"><br></div><div style="font-family:tahoma,sans-serif" class="gmail_default">Thanks.<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="HOEnZb"><font color="#888888"><br>-- <br><div class="m_1287899784910096018gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>
</div>