I'm trying to run the following PySide Qt Python example (code is at the bottom of this question):
https://github.com/Deusdies/pythonbo/blob/master/06-sixthTutorial-moresignals.py
I'm getting an error stating:
ASSERT: "pyMethod" in file /tmp/pyside-gUBW/pyside-qt4.8+1.1.2/libpyside/signalmanager.cpp, line 444
Any idea why this is happening at all, I'm running the code exactly as is, using Mac OS X 10.8.3. I have Python 2.7.4, as well as qt, and pyside installed via HomeBrew.
Any help would be appreciated!
import sys
from PySide.QtCore import *
from PySide.QtGui import *
class ZeroSpinBox(QSpinBox):
zeros = 0
def __init__(self, parent=None):
super(ZeroSpinBox, self).__init__(parent)
self.connect(self, SIGNAL("valueChanged(int)"), self.checkzero)
def checkzero(self):
if not self.value():
self.zeros += 1
self.nulls = 5
self.emit(SIGNAL("atZero"), self.zeros, self.nulls)
class Form(QDialog):
def __init__(self, parent=None):
super(Form, self).__init__(parent)
dial = QDial()
dial.setNotchesVisible(True)
zeroSpinBox = ZeroSpinBox()
layout = QHBoxLayout()
layout.addWidget(dial)
layout.addWidget(zeroSpinBox)
self.setLayout(layout)
self.connect(dial, SIGNAL("valueChanged(int)"), zeroSpinBox.setValue)
self.connect(zeroSpinBox, SIGNAL("valueChanged(int)"), dial.setValue)
self.connect(zeroSpinBox, SIGNAL("atZero"), self.announce)
self.setWindowTitle("Signals and Slots")
def announce(self, zeros, nulls):
print "Announcing!!!"
app = QApplication(sys.argv)
form = Form()
form.show()
app.exec_()
signalmanager.cpp
I managed to find a repository with the offending signalmanager.cpp source file online at :
https://github.com/jasonmccampbell/PySide/blob/master/libpyside/signalmanager.cpp#L444
Here's an excerpt from around line 444:
int SignalManager::callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* pyMethod, bool isShortCuit)
{
Q_ASSERT(pyMethod); // This is the line causing the exception?
Shiboken::GilState gil;
PyObject* pyArguments = 0;