7 Module implementing a dialog to show information about a connected board. |
7 Module implementing a dialog to show information about a connected board. |
8 """ |
8 """ |
9 |
9 |
10 import contextlib |
10 import contextlib |
11 |
11 |
12 from PyQt6.QtCore import QLocale |
12 from PyQt6.QtCore import QLocale, Qt |
13 from PyQt6.QtWidgets import QDialog, QTreeWidgetItem |
13 from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QTreeWidgetItem |
14 |
14 |
15 from .Ui_BoardDataDialog import Ui_BoardDataDialog |
15 from .Ui_BoardDataDialog import Ui_BoardDataDialog |
16 |
16 |
17 |
17 |
18 class BoardDataDialog(QDialog, Ui_BoardDataDialog): |
18 class BoardDataDialog(QDialog, Ui_BoardDataDialog): |
169 itm.setFirstColumnSpanned(True) |
169 itm.setFirstColumnSpanned(True) |
170 |
170 |
171 for col in range(self.dataTree.columnCount()): |
171 for col in range(self.dataTree.columnCount()): |
172 self.dataTree.resizeColumnToContents(col) |
172 self.dataTree.resizeColumnToContents(col) |
173 |
173 |
|
174 self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setDefault(True) |
|
175 self.buttonBox.setFocus(Qt.FocusReason.OtherFocusReason) |
|
176 |
174 def __createHeader(self, headerText): |
177 def __createHeader(self, headerText): |
175 """ |
178 """ |
176 Private method to create a header item. |
179 Private method to create a header item. |
177 |
180 |
178 @param headerText text for the header item |
181 @param headerText text for the header item |