It looks like you're new here. If you want to get involved, click one of these buttons!
I'm now developing a plugin upon klayout in Python.
I have a class derived from pya.QWidget as following:
class MyWidget(pya.QWidget):
def __init__(self):
super().__init()__
self.pushbutton_one = pya.QPushButton(self)
self.pushbutton_one.clicked.connect(self.clicked)
def clicked(self):
print("clicked")
It seems the pyqt connect syntax does not work, I get an error.
So I try to use pya.QObject.connect(self.pushbutton_one, "2clicked()", self, "1clicked()"), but it does not work either.
so I wonder how could I use emit, Q_SIGNALS, Q_SLOTS, connect in python code which will invoke Qt interfaces exposed by KLayout.
Comments
Hi William,
KLayout doesn't use pyqt. Signals can be bound directly to methods, so in fact no slots need to be defined.
It's as simple as this:
Matthias
Hi, Matthias
Now it works. Thanks for your comment.
William.