Answer the question
In order to leave comments, you need to log in
I tried to create a slot in PyQt4, but, for some reason, the IDE gives an error. How to create my own slot?
import sys
from PyQt4 import QtGui, QtCore
class SigSlot(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setWindowTitle('signal & slot')
but=QtGui.QPushButton('КНОПКА',self)
but.resize(200, 100)
but.clicked.connect(self.function)
def Scr(self):
print('test')
self.resize(250, 150)
app = QtGui.QApplication(sys.argv)
qb = SigSlot()
qb.show()
sys.exit(app.exec_())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question