I'm having three buttons on a form, what I expect for example is when I click the 5% button it prints 5%. But for some reason for all buttons it print's 60%.
And I really don't understand why?
My code is below.
class ThirdWindow(QWidget, Ui_Form3):
def __init__(self):
super(ThirdWindow, self).__init__()
self.dbu = DatabaseHandling.DatabaseUtility()
self.msl = None
# Show UI on screen + resize window
self.setupUi(self)
self.picIndicator.setPixmap(QPixmap("M:\QtProjects\\Resources\\138691.png"))
self.setFixedSize(350, 480)
# Define what should happen on button click
self.btnQuit.clicked.connect(lambda: self.close())
self.btnSixtyPercent.clicked.connect(lambda: self.check_clicked())
self.btnTenPercent.clicked.connect(lambda: self.check_clicked())
self.btnFivePercent.clicked.connect(lambda: self.check_clicked())
# TODO: Create a window that ask's for the spot it's specific color
'''def indication(self):
d = DialogOne()
d.exec_()'''
def check_clicked(self):
if self.btnSixtyPercent.text() == "60":
print("60%")
elif self.btnFivePercent.text() == "5":
print("5%")
elif self.btnTenPercent.text() == "10":
print("10%")
