display pairing results in choice table
This commit is contained in:
parent
9e602e8ca4
commit
4396b15c3a
9 changed files with 194 additions and 12 deletions
BIN
src/warchron/view/resources/cross-script.png
Normal file
BIN
src/warchron/view/resources/cross-script.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 663 B |
BIN
src/warchron/view/resources/map.png
Normal file
BIN
src/warchron/view/resources/map.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -603,15 +603,26 @@ class View(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
table = self.choicesTable
|
||||
table.setSortingEnabled(False)
|
||||
table.clearContents()
|
||||
table.setColumnCount(4)
|
||||
table.setHorizontalHeaderLabels(["Participant", "Priority", "Secondary", ""])
|
||||
table.setRowCount(len(participants))
|
||||
table.setIconSize(QSize(32, 16))
|
||||
for row, choice in enumerate(participants):
|
||||
participant_item = QtWidgets.QTableWidgetItem(choice.participant_name)
|
||||
priority_item = QtWidgets.QTableWidgetItem(choice.priority_sector)
|
||||
if choice.priority_icon:
|
||||
priority_item.setIcon(choice.priority_icon)
|
||||
secondary_item = QtWidgets.QTableWidgetItem(choice.secondary_sector)
|
||||
if choice.secondary_icon:
|
||||
secondary_item.setIcon(choice.secondary_icon)
|
||||
status_item = QtWidgets.QTableWidgetItem()
|
||||
if choice.fallback_icon:
|
||||
status_item.setIcon(choice.fallback_icon)
|
||||
participant_item.setData(Qt.ItemDataRole.UserRole, choice.id)
|
||||
table.setItem(row, 0, participant_item)
|
||||
table.setItem(row, 1, priority_item)
|
||||
table.setItem(row, 2, secondary_item)
|
||||
table.setItem(row, 3, status_item)
|
||||
table.setSortingEnabled(True)
|
||||
table.resizeColumnsToContents()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue