From anonymous, 9 Months ago, written in Python.
Embed
  1. class IntroMenu(QWidget):
  2.  
  3.     drink_clicked = pyqtSignal(bool)  # alcoholic
  4.     exit_clicked = pyqtSignal()
  5.  
  6.     def __init__(self, parent=None):
  7.         super().__init__(parent)
  8.         self.alcoholic_btn = QPushButton()
  9.         ...
  10.         # self.alcoholic_btn.clicked.connect(self.drink_clicked.emit)
  11.         self.alcoholic_btn.clicked.connect(lambda: self.drink_clicked.emit(True))
  12.  
  13.  
  14. class Controller:
  15.  
  16.     def __init__(self):
  17.         self.intro_menu = IntroMenu()
  18.         self.intro_menu.alcoholic_clicked.connect(self.saufen)
  19.