Example #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)
Example #2
0
class Player(QtGui.QWidget):
    #class Player(object):
    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)

    def btnPlus1_clicked(self):
        self.score += 1
        self.update_score()

    def btnMinus1_clicked(self):
        self.score -= 1
        self.update_score()

    def update_score(self):
        self.scoreboard.lcdPoints.display(str(self.score))
        self.emit(QtCore.SIGNAL('update_score'))
Example #3
0
class Player(QtGui.QWidget):
#class Player(object):
    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)

    def btnPlus1_clicked(self):
        self.score += 1
        self.update_score()

    def btnMinus1_clicked(self):
        self.score -= 1
        self.update_score()

    def update_score(self):
        self.scoreboard.lcdPoints.display(str(self.score))
        self.emit(QtCore.SIGNAL('update_score'))
Example #4
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)
Example #5
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_ScoreboardWidget()
     self.ui.setupUi(self)
Example #6
0
class Form(QtGui.QMainWindow):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_ScoreboardWidget()
        self.ui.setupUi(self)
Example #7
0
 def __init__(self, parent=None):
     QtGui.QWidget.__init__(self, parent)
     self.ui = Ui_ScoreboardWidget()
     self.ui.setupUi(self)
Example #8
0
class Form(QtGui.QMainWindow):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.ui = Ui_ScoreboardWidget()
        self.ui.setupUi(self)