> 1
> 2
> 1
class Test(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.button = QtGui.QPushButton('') self.button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_E)) self.button.setMaximumSize(100,100) self.key = 'G' print 1 self.connect(self.button, QtCore.SIGNAL('clicked()'), self.test(self.key)) def test(self,key): items[key].amount += 1 print 2
QObject.connect(QObject, SIGNAL(), QObject, SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 'NoneType' QObject.connect(QObject, SIGNAL(), callable, Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 'NoneType' QObject.connect(QObject, SIGNAL(), SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 3 has unexpected type 'NoneType'