Answers for "connect two mathod to the same button in pyq5"

0

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.connectionFunction)

@pyqtSlot()
def connectionFunction(self):
    self.firstFunction()
    self.secondFunction()
Posted by: Guest on June-14-2020
0

connect two mathod to the same button in pyq5

self.trainPreproBtn.clicked.connect(self.preproClicked, self.thresClicked)

@pyqtSlot()
def preproClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray,cv2.COLOR_BGR2GRAY)
    #(thresh, im_bw) = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
    #resize_image = cv2.resize(im_bw, (180, 180))
    self.displayImage(2)
@pyqtSlot()
def thresClicked(self):
    gray = cv2.cvtColor(self.image, cv2.IMREAD_COLOR)
    self.image = cv2.cvtColor(gray, cv2.COLOR_BGR2GRAY)
    self.image = cv2.threshold(self.image, 128, 255, cv2.THRESH_BINARY )
    self.displayImage(4)
Posted by: Guest on June-14-2020

Code answers related to "connect two mathod to the same button in pyq5"

Python Answers by Framework

Browse Popular Code Answers by Language