-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleaderboard_pop.py
103 lines (89 loc) · 5 KB
/
leaderboard_pop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Form implementation generated from reading ui file 'Leaderboard.ui'
#
# Created by: PyQt6 UI code generator 6.0.3
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_Form5(object):
def __init__(self, aux_players_sorted):
self.players_sorted = aux_players_sorted
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(263, 202)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("images/icon1.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
Form.setWindowIcon(icon)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
Form.setMinimumSize(QtCore.QSize(263, 202))
Form.setMaximumSize(QtCore.QSize(263, 202))
Form.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight)
Form.setStyleSheet("background-color:\"lightgreen\"\n"
"")
self.gridLayoutWidget = QtWidgets.QWidget(Form)
self.gridLayoutWidget.setGeometry(QtCore.QRect(30, 50, 230, 151))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.secondPnamelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.secondPnamelabel.setObjectName("secondPnamelabel")
self.gridLayout.addWidget(self.secondPnamelabel, 1, 0, 1, 1)
self.thirdPnamelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.thirdPnamelabel.setObjectName("thirdPnamelabel")
self.gridLayout.addWidget(self.thirdPnamelabel, 2, 0, 1, 1)
self.firstPnamelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.firstPnamelabel.setObjectName("firstPnamelabel")
self.gridLayout.addWidget(self.firstPnamelabel, 0, 0, 1, 1)
self.fourthPnamelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.fourthPnamelabel.setObjectName("fourthPnamelabel")
self.gridLayout.addWidget(self.fourthPnamelabel, 3, 0, 1, 1)
self.firstPscorelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.firstPscorelabel.setObjectName("firstPscorelabel")
self.gridLayout.addWidget(self.firstPscorelabel, 0, 1, 1, 1)
self.secondPscorelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.secondPscorelabel.setObjectName("secondPscorelabel")
self.gridLayout.addWidget(self.secondPscorelabel, 1, 1, 1, 1)
self.thirdPscorelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.thirdPscorelabel.setObjectName("thirdPscorelabel")
self.gridLayout.addWidget(self.thirdPscorelabel, 2, 1, 1, 1)
self.fourthPscorelabel = QtWidgets.QLabel(self.gridLayoutWidget)
self.fourthPscorelabel.setObjectName("fourthPscorelabel")
self.gridLayout.addWidget(self.fourthPscorelabel, 3, 1, 1, 1)
self.leadelabel = QtWidgets.QLabel(Form)
self.leadelabel.setGeometry(QtCore.QRect(90, 0, 111, 41))
font = QtGui.QFont()
font.setPointSize(12)
self.leadelabel.setFont(font)
self.leadelabel.setObjectName("leadelabel")
self.number_of_players = len(self.players_sorted)
self.firstPnamelabel.setText(self.players_sorted[self.number_of_players - 1][0])
self.firstPscorelabel.setText(str(self.players_sorted[self.number_of_players - 1][1]))
self.secondPnamelabel.setText(self.players_sorted[self.number_of_players - 2][0])
self.secondPscorelabel.setText(str(self.players_sorted[self.number_of_players - 2][1]))
if self.number_of_players == 3:
self.thirdPnamelabel.setText(self.players_sorted[self.number_of_players - 3][0])
self.thirdPscorelabel.setText(str(self.players_sorted[self.number_of_players - 3][1]))
if self.number_of_players == 4:
self.thirdPnamelabel.setText(self.players_sorted[self.number_of_players - 3][0])
self.thirdPscorelabel.setText(str(self.players_sorted[self.number_of_players - 3][1]))
self.fourthPnamelabel.setText(self.players_sorted[self.number_of_players - 4][0])
self.fourthPscorelabel.setText(str(self.players_sorted[self.number_of_players - 4][1]))
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Scrabble"))
self.leadelabel.setText(_translate("Form", "Leaderboard"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form5()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec())