示例#1
0
    def __init__(self, name, parent):
        super(Player, self).__init__()
        self.name = name
        self.score = 0

        # create widget and add it to main window
        self.scoreboard = Ui_ScoreboardWidget()
        self.scoreboard.setupUi(parent)
        self.scoreboard.setLayout(self.scoreboard.verticalLayout_2)
        parent.ui.horizontalLayout.addWidget(self.scoreboard)
        self.scoreboard.setLayout(self.scoreboard.verticalLayout_2)

        # set up signals etc
        self.scoreboard.lblPlayername.setText(parent.ui.ledPlayerName.text())
        self.scoreboard.btnPlus1.released.connect(self.btnPlus1_clicked)
        self.scoreboard.btnMinus1.released.connect(self.btnMinus1_clicked)
示例#2
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_ScoreboardWidget()
     self.ui.setupUi(self)