프로젝트

일반

사용자정보

개정판 4eafad26

ID4eafad266f21f5e04eb4bec701d02ae50ff5eead
상위 ff4dc28a
하위 8101ab74, 1af7088e

함의성이(가) 약 5년 전에 추가함

issue #1124: title block and text area on going

Change-Id: I9cfc49f9554b026c0d2d93276f1f5f416139f71d

차이점 보기:

DTI_PID/DTI_PID/ItemPropertyTableWidget.py
233 233

  
234 234
            self.setItem(2, 3, QTableWidgetItem(self._item.type))
235 235
            self.setItem(3, 3, QTableWidgetItem(self._item.text()))
236
            self.setItem(4, 3, QTableWidgetItem(self._item.area))
236 237
        finally:
237 238
            self.blockSignals(False)
238 239

  
......
370 371
                self.setRowCount(1)
371 372
                self.setItem(0, 1, QTableWidgetItem(self.tr("UID")))
372 373
            else:
373
                self.setRowCount(4)
374
                app_doc_data = AppDocData.instance()
375
                area_list = app_doc_data.getAreaList()
376
                title_area_list = app_doc_data.getTitleBlockProperties()
377
                self.setRowCount(5)
374 378
                self.setItem(0, 1, QTableWidgetItem(self.tr("UID")))
375 379
                self.setItem(1, 1, QTableWidgetItem(self.tr("OWNER")))
376 380
                self.setItem(2, 1, QTableWidgetItem(self.tr("Type")))
377 381
                self.setItem(3, 1, QTableWidgetItem(self.tr("Text")))
382
                widgetItem = QTableWidgetItem(self.tr("Area"))
383
                widgetItem.setData(Qt.UserRole, item)
384
                self.setItem(4, 1, widgetItem)
385
                self._areaComboBox = QComboBox(self)
386
                self._areaComboBox.tag = widgetItem
387
                self._areaComboBox.addItem('None')
388
                for title_area in title_area_list:
389
                    self._areaComboBox.addItem(title_area[1])
390
                for area in area_list:
391
                    self._areaComboBox.addItem(area.name)
392
                self.setCellWidget(4, 3, self._areaComboBox)
393
                self._areaComboBox.setCurrentText(item.area)
394
                self._areaComboBox.currentIndexChanged.connect(self.onAreaChanged)
378 395

  
379 396
            for index in range(self.rowCount()):
380 397
                item = self.item(index, 1)
......
398 415
        if type(data) is QEngineeringLineItem:
399 416
            self.changeConnectedLineType(data, lineType)
400 417

  
418
    def onAreaChanged(self, param):
419
        area = self._areaComboBox.itemText(param)
420
        data = self._areaComboBox.tag.data(Qt.UserRole)
421
        if type(data) is QEngineeringTextItem:
422
            data.area = area
423

  
401 424
    def changeConnectedLineType(self, line, lineType):
402 425
        line.lineType = lineType
403 426
        if type(line.connectors[0].connectedItem) is QEngineeringLineItem and \

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)