On 2/21/2013 12:52 PM, Zak wrote:
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.

Thanks for your comments. I think they were helpful, but the bug reproduction process here got pretty weird as I fiddle with this some more. I commonly use method 2 to connect signals and slots (I wasn't aware of method 3, but I think I see it's necessity at times). I changed the one connection to use method 1 and sure enough I think I don't get that failure any more.

(and now just a personal tale of woe this has led me down ...) However, I now see that regardless of signal/slot issues, that if I sit here and open,close,reopen and repeat continuously I'm sure to get signal/slot failures and missing attributes and even segfault crashes sometime in the first 30 open/close iterations. Unfortunately, this widget that I'm closing and reopening has nested sub-widgets probably 4 layers deep and many many nuances. It will take a while to decode this, but it certainly looks like memory corruption. I'm not going to hazard a guess about where to point a finger at this point aside to say that pure python pyside shouldn't segfault.

For the record ... I'm on win 7 32 bit; PySide 1.1.2; python 2.7.3; Qt 4.8.2.

Joel

_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to