프로젝트

일반

사용자정보

개정판 19ef241f

ID19ef241f78d99b7bd3b1f78e2fbcb12dc6303b44
상위 1b49dc55
하위 4195e345

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

issue #703: move refresh

차이점 보기:

DTI_PID/DTI_PID/Commands/SelectAttributeCommand.py
1 1
import os.path
2 2
import AbstractCommand
3
from EngineeringLineItem import QEngineeringLineItem
3 4
try:
4 5
    from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR, QEvent
5 6
    from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QCursor, QMouseEvent, QTransform
......
18 19
'''
19 20
class SelectAttributeCommand(AbstractCommand.AbstractCommand):
20 21

  
21
    onSuccess = pyqtSignal()
22
    onSuccess = pyqtSignal(QEngineeringLineItem)
22 23

  
23 24
    def __init__(self, item, attr, imageViewer):
24 25
        super(SelectAttributeCommand, self).__init__(imageViewer)
......
40 41
        if 'mouseReleaseEvent' == param[0] and event.button() == Qt.LeftButton:
41 42
            from SymbolSvgItem import SymbolSvgItem
42 43
            from EngineeringTextItem import QEngineeringTextItem
43
            from EngineeringLineItem import QEngineeringLineItem
44 44
            if self._attr is not None:
45 45
                item = self.imageViewer.scene.itemAt(scenePos, QTransform())
46 46
                if item is not None and self._attr.AttributeType == 'Text Item' and type(item) is QEngineeringTextItem:
......
80 80
                    self.onSuccess.emit()
81 81
                elif item is not None and self._attr.AttributeType == 'Line Conn' and issubclass(type(item), QEngineeringLineItem):
82 82
                    self._item.connectors[self._attr.ConnNum - 1].connectedItem = item
83
                    self._attr.tableRefresh(self._item)
84 83

  
85
                    self.onSuccess.emit()
84
                    self.onSuccess.emit(self._item)
86 85
                
87 86
        self.isTreated = True
88 87
        
DTI_PID/DTI_PID/ItemPropertyTableWidget.py
630 630
                attr = SymbolAttr()
631 631
                attr.AttributeType = "Line Conn"
632 632
                attr.ConnNum = int(keyCell.text().replace('CONN', ''))
633
                attr.tableRefresh = self.showItemProperty
634 633
                cmd = SelectAttributeCommand.SelectAttributeCommand(items[0], attr, self.mainWindow.graphicsView)
635 634
                cmd.onSuccess.connect(self.onSuccessSelectAttribute)
636 635
                self.mainWindow.graphicsView.command = cmd
......
643 642
        @author     kyouho
644 643
        @date       2018.10.23
645 644
    '''
646
    def onSuccessSelectAttribute(self):
647
        self.mainWindow.refreshResultPropertyTableWidget()
645
    def onSuccessSelectAttribute(self, connItem = None):
646
        if connItem is None:
647
            self.mainWindow.refreshResultPropertyTableWidget()
648
        else:
649
            self.showItemProperty(connItem)

내보내기 Unified diff

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