title: how to unclick a button after it has been clicked in pyqt5(resetting it)
body: <p>so i am programming in pyqt5, and i have a function that catches all of the buttons that have been clicked, so the problem is that the function contains if statements like, if </p>
  
  <pre><code>self.bo.clicked:
  blah blah blah
  </code></pre>
  
  <p>and so forth with about a dozen buttons or so,
  so the problem is once a button is clicked its .clicked value automatically becomes permanently True, is and if the different buttons have been clicked previously all of the if statements get triggered, I am wondering is there any way to dis-arm the .clicked property?</p>
  
  <p>what i have tried is:</p>
  
  <pre><code>if self.b0.clicked:
      self.bo.setEnabled(False)
      self.bo.setEnabled(True)
  #attempting to reset the button.
  </code></pre>
  
  <p>however that doesn't work, and once a button has been "clicked" and when i click another button they all automatically fire up. 
  I am a bit new to this, so please help me. Or maybe explain another way to do this?
  please and thank you!</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  # Form implementation generated from reading ui file 'yevsCalcUi.ui'
  #
  # Created by: PyQt5 UI code generator 5.10.1
  #
  # WARNING! All changes made in this file will be lost!
  
  from PyQt5 import QtCore, QtGui, QtWidgets
  import sys
  
  class Ui_MainWindow(object):
  
      def setupUi(self, MainWindow):
          self.work = []
          self.operators = []
          self.wrking = 0
          self.blin = 0
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(350, 300)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.gridLayout_4 = QtWidgets.QGridLayout(self.centralwidget)
          self.gridLayout_4.setObjectName("gridLayout_4")
          self.frame_4 = QtWidgets.QFrame(self.centralwidget)
          self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_4.setObjectName("frame_4")
          self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_4)
          self.gridLayout_5.setObjectName("gridLayout_5")
          self.frame = QtWidgets.QFrame(self.frame_4)
          self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame.setObjectName("frame")
          self.gridLayout_3 = QtWidgets.QGridLayout(self.frame)
          self.gridLayout_3.setObjectName("gridLayout_3")
          self.frame_3 = QtWidgets.QFrame(self.frame)
          self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_3.setObjectName("frame_3")
          self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_3)
          self.gridLayout_2.setObjectName("gridLayout_2")
          self.numbers = QtWidgets.QLabel(self.frame_3)
          self.numbers.setObjectName("numbers")
          self.numbers.setText("blin")
          self.gridLayout_2.addWidget(self.numbers, 0, 0, 1, 1)
          self.gridLayout_3.addWidget(self.frame_3, 0, 0, 1, 1)
          self.frame_2 = QtWidgets.QFrame(self.frame)
          self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
          self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
          self.frame_2.setObjectName("frame_2")
          self.gridLayout = QtWidgets.QGridLayout(self.frame_2)
          self.gridLayout.setObjectName("gridLayout")
          self.b3 = QtWidgets.QPushButton(self.frame_2)
          self.b3.setObjectName("b3")
          self.gridLayout.addWidget(self.b3, 3, 2, 1, 1)
          self.bac = QtWidgets.QPushButton(self.frame_2)
          self.bac.setObjectName("bac")
          self.gridLayout.addWidget(self.bac, 0, 0, 1, 1)
          self.bmul = QtWidgets.QPushButton(self.frame_2)
          self.bmul.setObjectName("bmul")
          self.gridLayout.addWidget(self.bmul, 0, 3, 1, 1)
          self.splitter_3 = QtWidgets.QSplitter(self.frame_2)
          self.splitter_3.setOrientation(QtCore.Qt.Horizontal)
          self.splitter_3.setObjectName("splitter_3")
          self.b7 = QtWidgets.QPushButton(self.splitter_3)
          self.b7.setObjectName("b7")
          self.b8 = QtWidgets.QPushButton(self.splitter_3)
          self.b8.setObjectName("b8")
          self.b9 = QtWidgets.QPushButton(self.splitter_3)
          self.b9.setObjectName("b9")
          self.bmin = QtWidgets.QPushButton(self.splitter_3)
          self.bmin.setObjectName("bmin")
          self.gridLayout.addWidget(self.splitter_3, 1, 0, 1, 4)
          self.bd = QtWidgets.QPushButton(self.frame_2)
          self.bd.setObjectName("bd")
          self.gridLayout.addWidget(self.bd, 4, 2, 1, 1)
          self.bdiv = QtWidgets.QPushButton(self.frame_2)
          self.bdiv.setObjectName("bdiv")
          self.gridLayout.addWidget(self.bdiv, 0, 2, 1, 1)
          self.b1 = QtWidgets.QPushButton(self.frame_2)
          self.b1.setObjectName("b1")
          self.gridLayout.addWidget(self.b1, 3, 0, 1, 1)
          self.splitter_2 = QtWidgets.QSplitter(self.frame_2)
          self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
          self.splitter_2.setObjectName("splitter_2")
          self.b4 = QtWidgets.QPushButton(self.splitter_2)
          self.b4.setObjectName("b4")
          self.b5 = QtWidgets.QPushButton(self.splitter_2)
          self.b5.setObjectName("b5")
          self.b6 = QtWidgets.QPushButton(self.splitter_2)
          self.b6.setObjectName("b6")
          self.bplu = QtWidgets.QPushButton(self.splitter_2)
          self.bplu.setObjectName("bplu")
  
          self.gridLayout.addWidget(self.splitter_2, 2, 0, 1, 4)
          self.b2 = QtWidgets.QPushButton(self.frame_2)
          self.b2.setObjectName("b2")
          self.gridLayout.addWidget(self.b2, 3, 1, 1, 1)
          self.bpm = QtWidgets.QPushButton(self.frame_2)
          self.bpm.setObjectName("bpm")
          self.gridLayout.addWidget(self.bpm, 0, 1, 1, 1)
          self.beq = QtWidgets.QPushButton(self.frame_2)
          self.beq.setMinimumSize(QtCore.QSize(0, 25))
          self.beq.setObjectName("beq")
          self.gridLayout.addWidget(self.beq, 3, 3, 1, 1)
          self.gridLayout_3.addWidget(self.frame_2, 1, 0, 1, 1)
          self.gridLayout_5.addWidget(self.frame, 0, 0, 1, 1)
          spacerItem = QtWidgets.QSpacerItem(572, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
          self.gridLayout_5.addItem(spacerItem, 0, 1, 1, 1)
          spacerItem1 = QtWidgets.QSpacerItem(20, 292, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
          self.gridLayout_5.addItem(spacerItem1, 1, 0, 1, 1)
          self.gridLayout_4.addWidget(self.frame_4, 0, 0, 1, 1)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 997, 22))
          self.menubar.setObjectName("menubar")
          self.b0 = QtWidgets.QPushButton(self.frame_2)
          self.b0.setObjectName("b0")
          numbas = []
          self.b0.setProperty('0', numbas)
  
          self.gridLayout.addWidget(self.b0, 4, 0, 1, 2)
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
          self.i = 0
  
          self.b0.clicked.connect(self.changeLabel)
  
          self.bplu.clicked.connect(self.changeLabel)
  
  
      def changeLabel(self):
          self.blin = self.blin + 1
          print("blin")
          self.numbers.setText("0")
          if self.b0.clicked:
              print("okay now that is Legit!")
              self.b0.setEnabled(False)
              self.b0.setEnabled(True)
              self.numbers.setText("0")
          if self.bplu.clicked:
              self.blin = 0
              print(self.blin)
  
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
          self.numbers.setText(_translate("MainWindow", "&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=\" font-size:24pt;\"&gt;blinulator&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"))
          self.b3.setText(_translate("MainWindow", "3"))
          self.bac.setText(_translate("MainWindow", "AC"))
          self.bmul.setText(_translate("MainWindow", "*"))
          self.b7.setText(_translate("MainWindow", "7"))
          self.b8.setText(_translate("MainWindow", "8"))
          self.b9.setText(_translate("MainWindow", "9"))
          self.bmin.setText(_translate("MainWindow", "-"))
          self.bd.setText(_translate("MainWindow", "."))
          self.bdiv.setText(_translate("MainWindow", "/"))
          self.b0.setText(_translate("MainWindow", "0"))
          self.b1.setText(_translate("MainWindow", "1"))
          self.b4.setText(_translate("MainWindow", "4"))
          self.b5.setText(_translate("MainWindow", "5"))
          self.b6.setText(_translate("MainWindow", "6"))
          self.bplu.setText(_translate("MainWindow", "+"))
          self.b2.setText(_translate("MainWindow", "2"))
          self.bpm.setText(_translate("MainWindow", "+/-"))
          self.beq.setText(_translate("MainWindow", "="))
  
  
  
  
  app = QtWidgets.QApplication(sys.argv)
  MainWindow = QtWidgets.QMainWindow()
  ui = Ui_MainWindow()
  ui.setupUi(MainWindow)
  MainWindow.show()
  sys.exit(app.exec_())
  </code></pre>