I have a problem with my code :/ My program needs to click a QFrame, QWidget or QGroupBox. At the moment I use mouseReleaseEvent but it only works when my function doesn\'t have
You have to assign a function to mousePressEvent
and self.testc("ssssss")
does (probably) not return a function.
What you can do is to create another function
def f(self):
return self.testc("ssssss")
and assign
self.frame.mousePressEvent = self.f
For such one-liners it is often preferred to create lambda
self.frame.mousePressEvent = lambda: self.tests("ssssss")