개정판 77caddfd
dev issue #640: edit Line Attribute form
DTI_PID/DTI_PID/AttrEditor_UI.py | ||
---|---|---|
30 | 30 |
self.comboBoxSymbolType = QtWidgets.QComboBox(self.groupBox) |
31 | 31 |
self.comboBoxSymbolType.setObjectName("comboBoxSymbolType") |
32 | 32 |
self.horizontalLayout.addWidget(self.comboBoxSymbolType) |
33 |
self.labelLineNo = QtWidgets.QLabel(self.groupBox) |
|
34 |
self.labelLineNo.setObjectName("labelLineNo") |
|
35 |
self.horizontalLayout.addWidget(self.labelLineNo) |
|
33 | 36 |
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) |
34 | 37 |
self.horizontalLayout.addItem(spacerItem) |
35 | 38 |
self.pushButtonAddAttr = QtWidgets.QPushButton(self.groupBox) |
... | ... | |
61 | 64 |
_translate = QtCore.QCoreApplication.translate |
62 | 65 |
AttrEditorDialog.setWindowTitle(_translate("AttrEditorDialog", "속성 편집")) |
63 | 66 |
self.groupBox.setTitle(_translate("AttrEditorDialog", "속성")) |
67 |
self.labelLineNo.setText(_translate("AttrEditorDialog", "Line No Attribute")) |
|
64 | 68 |
self.pushButtonAddAttr.setText(_translate("AttrEditorDialog", "+")) |
65 | 69 |
self.pushButtonDelAttr.setText(_translate("AttrEditorDialog", "-")) |
66 | 70 |
|
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
231 | 231 |
self.ui.tableWidgetColorProperty.cellDoubleClicked.connect(self.cellDoubleClick) |
232 | 232 |
self.ui.comboBoxColorOption.currentIndexChanged.connect(self.currentIndexChanged) |
233 | 233 |
self.ui.radioButtonRandom.toggled.connect(self.onPropertyToggled) |
234 |
self.ui.pushButtonLineNoAttribute.clicked.connect(self.editLineNoAttributeClicked) |
|
235 |
|
|
236 |
''' |
|
237 |
''' |
|
238 |
def editLineNoAttributeClicked(self): |
|
239 |
from SymbolAttrEditorDialog import QSymbolAttrEditorDialog |
|
240 |
try: |
|
241 |
dlg = QSymbolAttrEditorDialog(self) |
|
242 |
dlg.exec_() |
|
243 |
|
|
244 |
except Exception as ex: |
|
245 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
234 | 246 |
|
235 | 247 |
''' |
236 | 248 |
@brief Clear Table |
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
|
3 |
# Form implementation generated from reading ui file '.\ui\Configuration.ui'
|
|
3 |
# Form implementation generated from reading ui file './UI/Configuration.ui'
|
|
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.10.1
|
|
5 |
# Created by: PyQt5 UI code generator 5.9.2
|
|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
... | ... | |
224 | 224 |
self.radioButtonMetric.setObjectName("radioButtonMetric") |
225 | 225 |
self.horizontalLayout_7.addWidget(self.radioButtonMetric) |
226 | 226 |
self.radioButtonInch = QtWidgets.QRadioButton(self.groupBoxLineNo) |
227 |
self.radioButtonInch.setMinimumSize(QtCore.QSize(0, 0)) |
|
227 | 228 |
self.radioButtonInch.setObjectName("radioButtonInch") |
228 | 229 |
self.horizontalLayout_7.addWidget(self.radioButtonInch) |
230 |
self.pushButtonLineNoAttribute = QtWidgets.QPushButton(self.groupBoxLineNo) |
|
231 |
self.pushButtonLineNoAttribute.setMinimumSize(QtCore.QSize(50, 0)) |
|
232 |
self.pushButtonLineNoAttribute.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
|
233 |
self.pushButtonLineNoAttribute.setObjectName("pushButtonLineNoAttribute") |
|
234 |
self.horizontalLayout_7.addWidget(self.pushButtonLineNoAttribute) |
|
229 | 235 |
self.verticalLayout_2.addLayout(self.horizontalLayout_7) |
230 | 236 |
self.horizontalLayout_5 = QtWidgets.QHBoxLayout() |
231 | 237 |
self.horizontalLayout_5.setObjectName("horizontalLayout_5") |
... | ... | |
522 | 528 |
self.label_3.setText(_translate("ConfigurationDialog", "Size Unit : ")) |
523 | 529 |
self.radioButtonMetric.setText(_translate("ConfigurationDialog", "Metric")) |
524 | 530 |
self.radioButtonInch.setText(_translate("ConfigurationDialog", "Inch")) |
531 |
self.pushButtonLineNoAttribute.setText(_translate("ConfigurationDialog", "Line No Attribute")) |
|
525 | 532 |
self.label_2.setText(_translate("ConfigurationDialog", "Delimiter : ")) |
526 | 533 |
self.pushButtonAddDelimiter.setText(_translate("ConfigurationDialog", "추가")) |
527 | 534 |
self.label_26.setText(_translate("ConfigurationDialog", "Property : ")) |
DTI_PID/DTI_PID/SymbolAttrEditorDialog.py | ||
---|---|---|
13 | 13 |
import AttrEditor_UI |
14 | 14 |
|
15 | 15 |
class QSymbolAttrEditorDialog(QDialog): |
16 |
def __init__(self, parent, symbolType): |
|
16 |
def __init__(self, parent, symbolType = None):
|
|
17 | 17 |
QDialog.__init__(self, parent) |
18 | 18 |
|
19 |
self._symbolType = symbolType |
|
20 |
self.currentTypeId = 0 |
|
21 |
|
|
22 | 19 |
self.ui = AttrEditor_UI.Ui_AttrEditorDialog() |
23 | 20 |
self.ui.setupUi(self) |
24 |
## insert QTableWidgetEx |
|
25 |
self.ui.tableWidgetAttr = QTableWidgetEx(self.ui.groupBox) |
|
26 |
self.ui.tableWidgetAttr.setColumnCount(4) |
|
27 |
self.ui.tableWidgetAttr.setObjectName("tableWidgetAttr") |
|
28 |
self.ui.tableWidgetAttr.setRowCount(0) |
|
29 |
self.ui.tableWidgetAttr.verticalHeader().setVisible(False) |
|
30 |
self.ui.horizontalLayout_2.addWidget(self.ui.tableWidgetAttr) |
|
31 |
## up to here |
|
32 |
|
|
33 |
## combobox logic |
|
34 |
self.settingComboBoxSymbolType(symbolType[2]) |
|
35 |
self.ui.comboBoxSymbolType.currentTextChanged.connect(self.changeSymbolType) |
|
36 |
## up to here |
|
37 |
|
|
38 |
#self.ui.labelSelectedSymbolType.setText(symbolType[2]) |
|
39 | 21 |
|
40 |
self.ui.pushButtonAddAttr.clicked.connect(self.onAddAttr) |
|
41 |
self.ui.pushButtonDelAttr.clicked.connect(self.onDelAttr) |
|
22 |
self._symbolType = symbolType |
|
23 |
if symbolType is not None: |
|
24 |
self.ui.labelLineNo.setVisible(False) |
|
25 |
self.currentTypeId = 0 |
|
26 |
## insert QTableWidgetEx |
|
27 |
self.ui.tableWidgetAttr = QTableWidgetEx(self.ui.groupBox) |
|
28 |
self.ui.tableWidgetAttr.setColumnCount(4) |
|
29 |
self.ui.tableWidgetAttr.setObjectName("tableWidgetAttr") |
|
30 |
self.ui.tableWidgetAttr.setRowCount(0) |
|
31 |
self.ui.tableWidgetAttr.verticalHeader().setVisible(False) |
|
32 |
self.ui.horizontalLayout_2.addWidget(self.ui.tableWidgetAttr) |
|
33 |
## up to here |
|
34 |
## combobox logic |
|
35 |
self.settingComboBoxSymbolType(symbolType[2]) |
|
36 |
self.ui.comboBoxSymbolType.currentTextChanged.connect(self.changeSymbolType) |
|
37 |
## up to here |
|
38 |
self.ui.pushButtonAddAttr.clicked.connect(self.onAddAttr) |
|
39 |
self.ui.pushButtonDelAttr.clicked.connect(self.onDelAttr) |
|
40 |
self.ui.tableWidgetAttr.setHorizontalHeaderLabels(['UID', 'Name', 'Display Name', 'Type']) |
|
41 |
self.ui.tableWidgetAttr.horizontalHeaderItem(1).setSizeHint(QSize(25, 25)) |
|
42 |
self.ui.tableWidgetAttr.hideColumn(0) |
|
43 |
else: |
|
44 |
self.ui.comboBoxSymbolType.setVisible(False) |
|
45 |
## insert QTableWidgetEx |
|
46 |
self.ui.tableWidgetAttr = QTableWidgetEx(self.ui.groupBox) |
|
47 |
self.ui.tableWidgetAttr.setColumnCount(5) |
|
48 |
self.ui.tableWidgetAttr.setObjectName("tableWidgetAttr") |
|
49 |
self.ui.tableWidgetAttr.setRowCount(0) |
|
50 |
self.ui.tableWidgetAttr.verticalHeader().setVisible(False) |
|
51 |
self.ui.horizontalLayout_2.addWidget(self.ui.tableWidgetAttr) |
|
52 |
## up to here |
|
53 |
self.ui.tableWidgetAttr.setHorizontalHeaderLabels(['UID', 'Name', 'Display Name', 'Type', 'Limit Number']) |
|
54 |
self.ui.tableWidgetAttr.horizontalHeaderItem(1).setSizeHint(QSize(25, 25)) |
|
42 | 55 |
|
43 |
self.ui.tableWidgetAttr.setHorizontalHeaderLabels(['UID', 'Name', 'Display Name', 'Type']) |
|
44 |
self.ui.tableWidgetAttr.horizontalHeaderItem(1).setSizeHint(QSize(25, 25)) |
|
45 | 56 |
|
46 |
self.ui.tableWidgetAttr.hideColumn(0) |
|
47 | 57 |
|
48 | 58 |
''' |
49 | 59 |
@brief setting combobox symbolType |
... | ... | |
73 | 83 |
symbolType = self.ui.comboBoxSymbolType.currentText() |
74 | 84 |
self.loadData(symbolType) |
75 | 85 |
|
76 |
|
|
77 | 86 |
''' |
78 | 87 |
@brief load data |
79 | 88 |
@author humkyung |
... | ... | |
167 | 176 |
@date 2018.08.13 |
168 | 177 |
''' |
169 | 178 |
def accept(self): |
170 |
self.saveData() |
|
171 |
self.reSettingSceneAttribute() |
|
179 |
if self._symbolType is None: |
|
180 |
self.saveData() |
|
181 |
self.reSettingSceneAttribute() |
|
182 |
else: |
|
183 |
pass |
|
184 |
|
|
172 | 185 |
QDialog.accept(self) |
173 | 186 |
|
174 | 187 |
''' |
... | ... | |
179 | 192 |
def reSettingSceneAttribute(self): |
180 | 193 |
from App import App |
181 | 194 |
App.mainWnd().checkAttribute() |
195 |
|
|
196 |
''' |
|
197 |
''' |
|
198 |
def settingLineNoAttributeTable(self): |
|
199 |
table = self.ui.tableWidgetAttr |
|
200 |
appDocData = AppDocData.instance() |
|
201 |
|
|
202 |
|
|
203 |
|
DTI_PID/DTI_PID/UI/AttrEditor.ui | ||
---|---|---|
35 | 35 |
<widget class="QComboBox" name="comboBoxSymbolType"/> |
36 | 36 |
</item> |
37 | 37 |
<item> |
38 |
<widget class="QLabel" name="labelLineNo"> |
|
39 |
<property name="text"> |
|
40 |
<string>Line No Attribute</string> |
|
41 |
</property> |
|
42 |
</widget> |
|
43 |
</item> |
|
44 |
<item> |
|
38 | 45 |
<spacer name="horizontalSpacer"> |
39 | 46 |
<property name="orientation"> |
40 | 47 |
<enum>Qt::Horizontal</enum> |
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
380 | 380 |
</item> |
381 | 381 |
<item> |
382 | 382 |
<widget class="QRadioButton" name="radioButtonInch"> |
383 |
<property name="minimumSize"> |
|
384 |
<size> |
|
385 |
<width>0</width> |
|
386 |
<height>0</height> |
|
387 |
</size> |
|
388 |
</property> |
|
383 | 389 |
<property name="text"> |
384 | 390 |
<string>Inch</string> |
385 | 391 |
</property> |
386 | 392 |
</widget> |
387 | 393 |
</item> |
394 |
<item> |
|
395 |
<widget class="QPushButton" name="pushButtonLineNoAttribute"> |
|
396 |
<property name="minimumSize"> |
|
397 |
<size> |
|
398 |
<width>50</width> |
|
399 |
<height>0</height> |
|
400 |
</size> |
|
401 |
</property> |
|
402 |
<property name="maximumSize"> |
|
403 |
<size> |
|
404 |
<width>16777215</width> |
|
405 |
<height>16777215</height> |
|
406 |
</size> |
|
407 |
</property> |
|
408 |
<property name="text"> |
|
409 |
<string>Line No Attribute</string> |
|
410 |
</property> |
|
411 |
</widget> |
|
412 |
</item> |
|
388 | 413 |
</layout> |
389 | 414 |
</item> |
390 | 415 |
<item> |
내보내기 Unified diff