[PySide] RuntimeError: Failed to connect signal xxxx

Zak pyside at m.allo.ws
Thu Feb 21 18:52:13 CET 2013


The following idea helped me with a different glitch that was probably 
unrelated to yours, but who knows, it might help you. Try each of the 
following:

# Signals and slots example
# From qt_webview_play.py

@Slot(bool)  # bool is PySide.QtCore.bool
def my_slot(input_bool):
     pass

# The following three lines should be equivalent, but they
# are not always equivalent in practice:

q_widget.connect(q_widget, SIGNAL("toggled(bool)"), my_slot)
q_widget.toggled.connect(my_slot)
q_widget.toggled[bool].connect(my_slot)

I don't know why they are different, but sometimes they are. My bug 
arose when I tried to manually disconnect and reconnect signals, 
specifically the loadFinished(bool) signal on a QWebView widget.

In my own experience, it is best to always use the first method, with 
SIGNAL("toggled(bool)"). I notice that the StackOverflow question you 
linked uses the third method. Try switching it up and see if anything helps.

Good luck,

Zak Fallows

On 2/21/13 9:11 AM, Joel B. Mohler wrote:
> Does anyone recognize and know a solution for the "Failed to connect
> signal" traceback here?  I get this runtime error occasionally.
>
> Invalid Signal signature: toggled(bool)
> Traceback (most recent call last):
>     .... stuff ...
> RuntimeError: Failed to connect signal toggled(bool).
>
> I don't have any case that is small enough or public enough to post here
> in any detail, but I'm sure I'm not the only one who recognizes this on
> sight as the dreaded erratic failure-to-connect bug.  I have two
> different apps which exhibit the issue (different signals).  The
> question at
> http://stackoverflow.com/questions/8881048/getting-erratic-invalid-signal-signature-errors-in-pyside-qwebpage
> seems to me to be just as bizarre and surely related to my own conundrums.
>
> Despite all my reluctance to post code, I do have to admit that it is
> clear to me that certain signals have it happen and some never do.  That
> is, I have never seen this error occur for the vast majority of signals
> I connect, but there are just a few that it happens on maybe 1 in 20 times.
>
> Any thoughts on this?
>
> Thanks,
> Joel
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130221/3de78b98/attachment.html>


More information about the PySide mailing list