개정판 dffe8a9e
issue #1165: fixed Special Item Type 설정
Change-Id: I9ee026c753e7a96c038530ed52d425e3307376bc
DTI_PID/DTI_PID/SpecialItemTypesDialog.py | ||
---|---|---|
14 | 14 |
class QSpecialItemTypesDialog(QDialog): |
15 | 15 |
""" This Special Item Types dialog class """ |
16 | 16 |
|
17 |
CODE_TABLES = ('Special Item Types') |
|
18 |
|
|
19 | 17 |
def __init__(self, parent): |
20 | 18 |
QDialog.__init__(self, parent) |
21 | 19 |
|
... | ... | |
24 | 22 |
|
25 | 23 |
self.ui.tableWidgetSpecialItemTypes.setSortingEnabled(True) |
26 | 24 |
|
27 |
#DB Table명 기준으로 작성 |
|
28 |
for table in QSpecialItemTypesDialog.CODE_TABLES: |
|
29 |
self.load_data(table) |
|
25 |
self.load_data() |
|
30 | 26 |
|
31 | 27 |
''' |
32 | 28 |
@brief Setting Table |
33 | 29 |
@author humkyung |
34 | 30 |
@date 2019.08.10 |
35 | 31 |
''' |
36 |
def load_data(self, table_name):
|
|
32 |
def load_data(self): |
|
37 | 33 |
try: |
38 | 34 |
app_doc_data = AppDocData.instance() |
39 | 35 |
|
40 | 36 |
self.ui.tableWidgetSpecialItemTypes.horizontalHeader().setStretchLastSection(True) |
41 | 37 |
self.ui.tableWidgetSpecialItemTypes.setColumnCount(4) |
42 | 38 |
self.ui.tableWidgetSpecialItemTypes.setHorizontalHeaderLabels(['UID', 'Code', 'Type', 'Allowables']) |
43 |
self.ui.tableWidgetSpecialItemTypes.hideColumn(0) |
|
44 | 39 |
|
45 | 40 |
self.fill_data() |
46 | 41 |
self.add_new_row() |
47 | 42 |
|
43 |
self.ui.tableWidgetSpecialItemTypes.hideColumn(0) |
|
48 | 44 |
self.ui.tableWidgetSpecialItemTypes.horizontalHeaderItem(1).setSizeHint(QSize(30, 30)) |
49 | 45 |
self.ui.tableWidgetSpecialItemTypes.cellChanged.connect(self.cellValueChanged) |
50 | 46 |
except Exception as ex: |
... | ... | |
67 | 63 |
row = 0 |
68 | 64 |
for special_item_type in special_item_types: |
69 | 65 |
uid_item = QTableWidgetItem(special_item_type[0]) |
70 |
uid_item.tag = special_item_type[0] |
|
71 | 66 |
self.ui.tableWidgetSpecialItemTypes.setItem(row, 0, uid_item) # UID |
72 | 67 |
|
73 | 68 |
code_item = QTableWidgetItem(special_item_type[1]) |
... | ... | |
77 | 72 |
type_combobox = QComboBox() |
78 | 73 |
type_combobox.addItem('String') |
79 | 74 |
type_combobox.addItem('Symbol') |
75 |
self.ui.tableWidgetSpecialItemTypes.setCellWidget(row, 2, type_combobox) |
|
80 | 76 |
index = type_combobox.findText(special_item_type[2]) # Type |
81 | 77 |
type_combobox.setCurrentIndex(index) if index != -1 else type_combobox.setCurrentIndex(0) |
82 |
self.ui.tableWidgetSpecialItemTypes.setCellWidget(row, 2, type_combobox) |
|
83 | 78 |
|
84 | 79 |
allowables_item = QTableWidgetItem(special_item_type[3]) |
85 | 80 |
allowables_item.tag = special_item_type[3] |
내보내기 Unified diff