title: PYQT5 update Label in 2nd window everytime variable changes
body: <p>So I want do display a global variable (= currenteMoney) in my second Window (= moneywindow1). It works fine, but everytime I change the value of my variable in my Mainwindow, the lable that displays the variable in my second window should update. </p>
  
  <pre><code>from cheatwindow import cheatwindow1
  from moneywindow import moneywindow1
  import globals
  
  class MyWindow(QMainWindow):
      def __init__(self):
          super(MyWindow, self).__init__()
          self.cheatwindow1 = None
          self.moneywindow1 = None
          self.setGeometry(600, 200, 800, 600)
          self.setWindowTitle("MyMainWindow")
          self.initUI()
  
      def initUI(self):
          globals.global_vars()
  
          mainMenu = self.menuBar()
          fileMenu = mainMenu.addMenu('File')
          save = QAction('New', self)
          save.setShortcut("Ctrl+S")
          save.triggered.connect(lambda: self.clicked_menu(0))
          load = QAction('Load', self)
          load.setShortcut("Ctrl+L")
          load.triggered.connect(lambda: self.clicked_menu(1))
          fileMenu.addAction(save)
          fileMenu.addAction(load)
  
          specialsMenu = mainMenu.addMenu('Specials')
          cheats = QAction("cheats", self)
          cheats.setShortcut("Ctrl+C")
          cheats.triggered.connect(lambda: self.clicked_menu(2))
          specialsMenu.addAction(cheats)
  
  # Button that if clicked changes the variable
          self.ButtonThrow = QtWidgets.QPushButton(self)
          self.ButtonThrow.setText("Roll dice")
          self.ButtonThrow.move(300, 300)
          self.ButtonThrow.adjustSize()
          self.ButtonThrow.setEnabled(True)
          self.ButtonThrow.clicked.connect(lambda: self.throw_dice(0))
  
      def clicked_menu(self, a):
          if a == 0:
              print("Save")
          elif a == 1:
              self.money_popup()
          elif a== 2:
              self.cheat_popup()
          else:
              pass
  
  # def that changes the variable
      def throw_dice(self, a):
          if a == 0:
              self.ButtonThrow.setEnabled(False)
              globals.currentThrow = random.randint(1, globals.diceMax)
              globals.currentMoney += globals.currentThrow*globals.diceCount
              QTimer.singleShot(globals.cdThrow*1000, lambda: 
          self.ButtonThrow.setEnabled(True))
          elif a == 1:
              pass
          self.labelWürfelpoints.setText("Letzer Wurf: " + 
                 str(globals.currentThrow) + "\n" + "Gesamtpunktzahl: "+ 
                 str(globals.currentMoney))
          self.labelWürfelpoints.adjustSize()
  
  # Opens the 2.nd window
      def money_popup(self):
          if self.moneywindow1 is None:
              self.moneywindow1 = moneywindow1()
          self.moneywindow1.show()
          self.moneywindow1.activateWindow()
  
  
      def cheat_popup(self):
          if self.cheatwindow1 is None:
              self.cheatwindow1 = cheatwindow1()
          self.cheatwindow1.show()
          self.cheatwindow1.activateWindow()
  
  def window():
      app = QApplication(sys.argv)
      win = MyWindow()
      win.show()
      sys.exit(app.exec_())
  
  window()
  </code></pre>
  
  <p>script of my 2nd window that displays the variable:</p>
  
  <pre><code>import globals
  
  class moneywindow1(QDialog):
      def __init__(self):
          super(moneywindow1, self).__init__()
          self.setGeometry(800, 400, 250, 200)
          self.setWindowTitle("MONEY")
          self.setupUi()
  
      def setupUi(self):
          globals.global_vars()
  
          self.label1 = QtWidgets.QLabel(self)
          font = QtGui.QFont()
          font.setPointSize(14)
          self.label1.setFont(font)
          self.label1.move(100, 80)
          self.label1.setText(str(globals.currentMoney))
          self.label1.adjustSize()
  
  # def that updates the lable so the current value of the variable is displayed
      def moneywin_updater(self):
          self.label1.setText(str(globals.currentMoney))
          self.label1.adjustSize()
  
  if __name__ == "__main__":
      import sys
      app2 = QApplication(sys.argv)
      win2 = moneywindow1()
      win2.show()
      sys.exit(app2.exec_())
  </code></pre>
  
  <p>The thing is, my variable (= currentMoney) can also be changed in my 3rd window (= cheatwindow1) so it would be nice to finde a general solution that is not bind to changes only done in the mainwindow. Btw the "import globals" script is here:</p>
  
  <pre><code>def global_vars():
      global currentMoney
      currentMoney = 0
  </code></pre>