title: How to update value of QLCDNumber on PyQT5?
body: <p>I am trying to update my QLCDNumber, but I failed several times. In my code, you can see that I want to take the input numbers from the double spin boxes and show them as a total sum of the previous land use values in my LCD widget. I have created a function with .value() but it doesn't work properly. The code is bit large, but I highlighted the QLCDNumber part.</p>
  
  <p>Screenshot here: </p>
  
  <p>values to take as inputs</p>
  
  <p><img src="https://i.stack.imgur.com/EBHGu.png" alt="">  </p>
  
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(1039, 654)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
          self.tabWidget.setGeometry(QtCore.QRect(10, 0, 1001, 621))
          self.tabWidget.setObjectName("tabWidget")
          self.tab = QtWidgets.QWidget()
          self.tab.setObjectName("tab")
          self.groupBox = QtWidgets.QGroupBox(self.tab)
          self.groupBox.setGeometry(QtCore.QRect(10, 40, 241, 521))
          font = QtGui.QFont()
          font.setPointSize(11)
          self.groupBox.setFont(font)
          self.groupBox.setTitle("")
          self.groupBox.setObjectName("groupBox")
          self.layoutWidget_5 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_5.setGeometry(QtCore.QRect(0, 50, 234, 26))
          self.layoutWidget_5.setObjectName("layoutWidget_5")
          self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget_5)
          self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_2.setObjectName("horizontalLayout_2")
          self.grass_label = QtWidgets.QLabel(self.layoutWidget_5)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.grass_label.setFont(font)
          self.grass_label.setObjectName("grass_label")
          self.horizontalLayout_2.addWidget(self.grass_label)
          self.grass_value = QtWidgets.QDoubleSpinBox(self.layoutWidget_5)
          self.grass_value.setSingleStep(0.05)
          self.grass_value.setObjectName("grass_value")
          self.horizontalLayout_2.addWidget(self.grass_value)
          self.layoutWidget_6 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_6.setGeometry(QtCore.QRect(0, 80, 234, 26))
          self.layoutWidget_6.setObjectName("layoutWidget_6")
          self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.layoutWidget_6)
          self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_3.setObjectName("horizontalLayout_3")
          self.arable_label = QtWidgets.QLabel(self.layoutWidget_6)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.arable_label.setFont(font)
          self.arable_label.setObjectName("arable_label")
          self.horizontalLayout_3.addWidget(self.arable_label)
          self.arab_value = QtWidgets.QDoubleSpinBox(self.layoutWidget_6)
          self.arab_value.setSingleStep(0.05)
          self.arab_value.setObjectName("arab_value")
          self.horizontalLayout_3.addWidget(self.arab_value)
          self.layoutWidget_7 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_7.setGeometry(QtCore.QRect(0, 110, 234, 26))
          self.layoutWidget_7.setObjectName("layoutWidget_7")
          self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.layoutWidget_7)
          self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_4.setObjectName("horizontalLayout_4")
          self.woodl_label = QtWidgets.QLabel(self.layoutWidget_7)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.woodl_label.setFont(font)
          self.woodl_label.setObjectName("woodl_label")
          self.horizontalLayout_4.addWidget(self.woodl_label)
          self.wood_value = QtWidgets.QDoubleSpinBox(self.layoutWidget_7)
          self.wood_value.setSingleStep(0.05)
          self.wood_value.setObjectName("wood_value")
          self.horizontalLayout_4.addWidget(self.wood_value)
          self.layoutWidget_8 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_8.setGeometry(QtCore.QRect(0, 140, 234, 26))
          self.layoutWidget_8.setObjectName("layoutWidget_8")
          self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.layoutWidget_8)
          self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_5.setObjectName("horizontalLayout_5")
          self.mount_label = QtWidgets.QLabel(self.layoutWidget_8)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.mount_label.setFont(font)
          self.mount_label.setObjectName("mount_label")
          self.horizontalLayout_5.addWidget(self.mount_label)
          self.mount_value = QtWidgets.QDoubleSpinBox(self.layoutWidget_8)
          self.mount_value.setSingleStep(0.05)
          self.mount_value.setObjectName("mount_value")
          self.horizontalLayout_5.addWidget(self.mount_value)
          self.start_butt = QtWidgets.QPushButton(self.groupBox)
          self.start_butt.setGeometry(QtCore.QRect(50, 290, 113, 32))
          self.start_butt.setObjectName("start_butt")
          self.landuse_label = QtWidgets.QLabel(self.groupBox)
          self.landuse_label.setGeometry(QtCore.QRect(20, 0, 201, 21))
          font = QtGui.QFont()
          font.setFamily("Arial")
          font.setPointSize(18)
          self.landuse_label.setFont(font)
          self.landuse_label.setLayoutDirection(QtCore.Qt.LeftToRight)
          self.landuse_label.setMidLineWidth(0)
          self.landuse_label.setObjectName("landuse_label")
          self.increase_label = QtWidgets.QLabel(self.groupBox)
          self.increase_label.setGeometry(QtCore.QRect(20, 210, 201, 21))
          font = QtGui.QFont()
          font.setFamily("Arial")
          font.setPointSize(18)
          self.increase_label.setFont(font)
          self.increase_label.setLayoutDirection(QtCore.Qt.LeftToRight)
          self.increase_label.setMidLineWidth(0)
          self.increase_label.setObjectName("increase_label")
          self.rainfall_value = QtWidgets.QDoubleSpinBox(self.groupBox)
          self.rainfall_value.setGeometry(QtCore.QRect(50, 240, 110, 24))
          self.rainfall_value.setDecimals(1)
          self.rainfall_value.setSingleStep(1.0)
          self.rainfall_value.setObjectName("rainfall_value")
          self.layoutWidget_9 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_9.setGeometry(QtCore.QRect(0, 170, 234, 26))
          self.layoutWidget_9.setObjectName("layoutWidget_9")
          self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.layoutWidget_9)
          self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_6.setObjectName("horizontalLayout_6")
  
        # Here is the code for the LCD Number
        # -----------------------------------------------------------
          self.total_label = QtWidgets.QLabel(self.layoutWidget_9)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.total_label.setFont(font)
          self.total_label.setObjectName("total_label")
          self.horizontalLayout_6.addWidget(self.total_label)
          self.total_sum = QtWidgets.QLCDNumber(self.layoutWidget_9)
          font = QtGui.QFont()
          font.setPointSize(10)
          self.total_sum.setFont(font)
          self.total_sum.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
          self.total_sum.setProperty("value", 0.0)
          self.total_sum.setObjectName("total_sum")
          self.horizontalLayout_6.addWidget(self.total_sum)
        # -----------------------------------------------------------
          self.layoutWidget_10 = QtWidgets.QWidget(self.groupBox)
          self.layoutWidget_10.setGeometry(QtCore.QRect(0, 20, 234, 26))
          self.layoutWidget_10.setObjectName("layoutWidget_10")
          self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.layoutWidget_10)
          self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
          self.horizontalLayout_7.setObjectName("horizontalLayout_7")
          self.urban_label = QtWidgets.QLabel(self.layoutWidget_10)
          font = QtGui.QFont()
          font.setPointSize(12)
          self.urban_label.setFont(font)
          self.urban_label.setObjectName("urban_label")
          self.horizontalLayout_7.addWidget(self.urban_label)
          self.urban_value = QtWidgets.QDoubleSpinBox(self.layoutWidget_10)
          self.urban_value.setSingleStep(0.05)
          self.urban_value.setObjectName("urban_value")
          self.horizontalLayout_7.addWidget(self.urban_value)
          self.powered_by_label = QtWidgets.QLabel(self.tab)
          self.powered_by_label.setGeometry(QtCore.QRect(460, 570, 111, 16))
          font = QtGui.QFont()
          font.setPointSize(11)
          self.powered_by_label.setFont(font)
          self.powered_by_label.setObjectName("powered_by_label")
          self.landuse_label_2 = QtWidgets.QLabel(self.tab)
          self.landuse_label_2.setGeometry(QtCore.QRect(330, 10, 421, 21))
          font = QtGui.QFont()
          font.setFamily("Arial")
          font.setPointSize(18)
          self.landuse_label_2.setFont(font)
          self.landuse_label_2.setLayoutDirection(QtCore.Qt.LeftToRight)
          self.landuse_label_2.setMidLineWidth(0)
          self.landuse_label_2.setObjectName("landuse_label_2")
          self.hydrograph_widget = QtWidgets.QGroupBox(self.tab)
          self.hydrograph_widget.setGeometry(QtCore.QRect(280, 60, 711, 501))
          font = QtGui.QFont()
          font.setFamily("Arial")
          font.setPointSize(14)
          self.hydrograph_widget.setFont(font)
          self.hydrograph_widget.setObjectName("hydrograph_widget")
          self.plot_widget = QtWidgets.QWidget(self.hydrograph_widget)
          self.plot_widget.setGeometry(QtCore.QRect(10, 30, 691, 461))
          self.plot_widget.setObjectName("plot_widget")
          self.tabWidget.addTab(self.tab, "")
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 1039, 22))
          self.menubar.setObjectName("menubar")
          self.menuMenu = QtWidgets.QMenu(self.menubar)
          self.menuMenu.setObjectName("menuMenu")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
          self.actionClose = QtWidgets.QAction(MainWindow)
          self.actionClose.setCheckable(False)
          self.actionClose.setObjectName("actionClose")
          self.menuMenu.addAction(self.actionClose)
          self.menubar.addAction(self.menuMenu.menuAction())
  
          self.retranslateUi(MainWindow)
          self.tabWidget.setCurrentIndex(0)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
          MainWindow.setTabOrder(self.urban_value, self.grass_value)
          MainWindow.setTabOrder(self.grass_value, self.arab_value)
          MainWindow.setTabOrder(self.arab_value, self.wood_value)
          MainWindow.setTabOrder(self.wood_value, self.mount_value)
          MainWindow.setTabOrder(self.mount_value, self.rainfall_value)
          MainWindow.setTabOrder(self.rainfall_value, self.start_butt)
          MainWindow.setTabOrder(self.start_butt, self.tabWidget)
  
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
          self.grass_label.setText(_translate("MainWindow", "Grassland"))
          self.arable_label.setText(_translate("MainWindow", "Arable"))
          self.woodl_label.setText(_translate("MainWindow", "Woodland"))
          self.mount_label.setText(_translate("MainWindow", "Mountain"))
          self.start_butt.setText(_translate("MainWindow", "Start"))
          self.landuse_label.setText(_translate("MainWindow", "Land Use Coverage (%)"))
          self.increase_label.setText(_translate("MainWindow", "Increase in Rainfall (%)"))
          self.total_label.setText(_translate("MainWindow", "Total"))
          self.urban_label.setText(_translate("MainWindow", "Urban"))
          self.powered_by_label.setText(_translate("MainWindow", "Powered by Group 1"))
          self.landuse_label_2.setText(_translate("MainWindow", "Hydrological Modelling for the Ouseburn Catchment"))
          self.hydrograph_widget.setTitle(_translate("MainWindow", "Hydrograph"))
          self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "HydroModel v.1.0"))
          self.menuMenu.setTitle(_translate("MainWindow", "Menu"))
          self.actionClose.setText(_translate("MainWindow", "Close"))
  
  #---------------------------------------------------------------------
     # Here is my code for updating the LCDNumber
  
      def all_inputs(self):    
          urban_inp = self.urban_value.value()
          grass_inp = self.grass_value.value()
          arab_inp = self.arab_value.value()
          wood_inp = self.wood_value.value()
          mount_inp = self.mount_value.value()
          total = urban_inp + grass_inp + arab_inp + wood_inp + mount_inp 
          self.total_sum.display(total)
  
  #---------------------------------------------------------------------
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>