개정판 cfb5e6ff
issue #958: add line transparency
Change-Id: Id68592a44bc98aacc8f7117d612a53fd3e589132
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
331 | 331 |
|
332 | 332 |
configs = self.getConfigs('LineTypes') |
333 | 333 |
for config in configs: |
334 |
width, _style = config.value.split(',') |
|
334 |
width, _style, transparent = config.value.split(',')
|
|
335 | 335 |
matches = [param for param in styleMap if param[0] == _style] |
336 | 336 |
style = matches[0][1] if matches else Qt.SolidLine |
337 |
self._lineTypeConfigs.append((config.key, int(width), style)) |
|
337 |
self._lineTypeConfigs.append((config.key, int(width), style, float(transparent)))
|
|
338 | 338 |
|
339 | 339 |
return self._lineTypeConfigs |
340 | 340 |
|
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
137 | 137 |
configs = docData.getConfigs('LineTypes') |
138 | 138 |
|
139 | 139 |
lineTypes = docData.getLineTypes() |
140 |
self.ui.tableWidgetLineTypes.setColumnCount(3)
|
|
141 |
self.ui.tableWidgetLineTypes.setHorizontalHeaderLabels(['Name', 'Width', 'Style']) |
|
140 |
self.ui.tableWidgetLineTypes.setColumnCount(4)
|
|
141 |
self.ui.tableWidgetLineTypes.setHorizontalHeaderLabels(['Name', 'Width', 'Style', 'Transparent '])
|
|
142 | 142 |
self.ui.tableWidgetLineTypes.setRowCount(len(lineTypes)) |
143 | 143 |
row = 0 |
144 | 144 |
for lineType in lineTypes: |
... | ... | |
148 | 148 |
|
149 | 149 |
### line width |
150 | 150 |
lineWidthSpinBox = QSpinBox() |
151 |
lineWidthSpinBox.setRange(1, 10)
|
|
151 |
lineWidthSpinBox.setRange(1, 25)
|
|
152 | 152 |
lineWidthSpinBox.setSingleStep(1) |
153 | 153 |
matches = [config for config in configs if config.key == lineType] |
154 |
lineWidthSpinBox.setValue(int(matches[0].value.split(',')[0])) if matches else lineWidthSpinBox.setValue(1)
|
|
154 |
lineWidthSpinBox.setValue(int(matches[0].value.split(',')[0])) if matches else lineWidthSpinBox.setValue(5)
|
|
155 | 155 |
self.ui.tableWidgetLineTypes.setCellWidget(row, 1, lineWidthSpinBox) |
156 | 156 |
|
157 | 157 |
## line style |
... | ... | |
160 | 160 |
lineStyleComboBox.setCurrentText(matches[0].value.split(',')[1]) if matches else lineStyleComboBox.setCurrentText('SolidLine') |
161 | 161 |
self.ui.tableWidgetLineTypes.setCellWidget(row, 2, lineStyleComboBox) |
162 | 162 |
|
163 |
### line transparent |
|
164 |
lineTransparentSpinBox = QSpinBox() |
|
165 |
lineTransparentSpinBox.setRange(10, 100) |
|
166 |
lineTransparentSpinBox.setSingleStep(10) |
|
167 |
lineTransparentSpinBox.setValue(int(matches[0].value.split(',')[2])) if matches else lineTransparentSpinBox.setValue(100) |
|
168 |
self.ui.tableWidgetLineTypes.setCellWidget(row, 3, lineTransparentSpinBox) |
|
169 |
|
|
163 | 170 |
row += 1 |
164 | 171 |
|
165 | 172 |
self.ui.tableWidgetLineTypes.horizontalHeaderItem(0).setSizeHint(QSize(30, 30)) |
173 |
self.ui.tableWidgetLineTypes.setColumnWidth(2, 135) |
|
166 | 174 |
|
167 | 175 |
self.ui.labelFontName.setBuddy(self.ui.fontComboBox) |
168 | 176 |
configs = docData.getConfigs('Text Style', 'Font Name') |
... | ... | |
538 | 546 |
lineType = self.ui.tableWidgetLineTypes.item(row, 0).text() |
539 | 547 |
width = self.ui.tableWidgetLineTypes.cellWidget(row, 1).text() |
540 | 548 |
style = self.ui.tableWidgetLineTypes.cellWidget(row, 2).currentText() |
541 |
configs.append(Config('LineTypes', lineType, '{},{}'.format(width, style))) |
|
549 |
transparent = self.ui.tableWidgetLineTypes.cellWidget(row, 3).text() |
|
550 |
configs.append(Config('LineTypes', lineType, '{},{},{}'.format(width, style,transparent))) |
|
542 | 551 |
|
543 | 552 |
docData = AppDocData.instance() |
544 | 553 |
|
DTI_PID/DTI_PID/Shapes/EngineeringLineItem.py | ||
---|---|---|
146 | 146 |
_pen.setWidth(config[1]) |
147 | 147 |
_pen.setStyle(config[2]) |
148 | 148 |
self.setPen(_pen) |
149 |
self.setOpacity(config[3] / 100) |
|
149 | 150 |
self.update() |
150 | 151 |
|
151 | 152 |
''' |
내보내기 Unified diff