개정판 3b45be93
HandCommand 내에서 canPan 변수 사용하지 않도록 수정/QSymbolDisplayDialog 실행 시 필요한 symbol type 전달하도록 수정
DTI_PID/DTI_PID/Commands/HandCommand.py | ||
---|---|---|
24 | 24 |
event = param[1] |
25 | 25 |
scenePos = param[2] |
26 | 26 |
if 'mousePressEvent' == param[0] and event.button() == Qt.LeftButton: |
27 |
if self.imageViewer.canPan: |
|
28 |
self.imageViewer.setDragMode(QGraphicsView.ScrollHandDrag)
|
|
27 |
#if self.imageViewer.canPan:
|
|
28 |
self.imageViewer.setDragMode(QGraphicsView.ScrollHandDrag) |
|
29 | 29 |
|
30 | 30 |
self.imageViewer.leftMouseButtonPressed.emit(scenePos.x(), scenePos.y()) |
31 | 31 |
#QGraphicsView.mousePressEvent(self.imageViewer, event) |
DTI_PID/DTI_PID/QDirTreeWidget.py | ||
---|---|---|
32 | 32 |
indexes = self.selectedIndexes() |
33 | 33 |
itemPosition = self.mapTo(self, position) |
34 | 34 |
item = self.itemAt(itemPosition) |
35 |
sym = self.getSymbolByItemName(item, 0) |
|
35 | 36 |
text = item.text(0) |
36 | 37 |
if len(indexes) > 0: |
37 | 38 |
level = 0 |
... | ... | |
45 | 46 |
editSymbolAction.triggered.connect(lambda: self.editSymbolActionClickEvent(item, 0)) |
46 | 47 |
menu.addAction(editSymbolAction) |
47 | 48 |
displaySymbolAction = QAction(self.tr("Display Symbol")) |
48 |
displaySymbolAction.triggered.connect(lambda: self.displaySymbolActionClickEvent(text)) |
|
49 |
displaySymbolAction.triggered.connect(lambda: self.displaySymbolActionClickEvent(sym.getType(), text))
|
|
49 | 50 |
menu.addAction(displaySymbolAction) |
50 | 51 |
deleteSymbolAction = QAction(self.tr("Delete Symbol")) |
51 |
parentText = "" |
|
52 |
if item.parent() is not None: |
|
53 |
parentText = item.parent().text(0) |
|
54 |
deleteSymbolAction.triggered.connect(lambda: self.deleteSymbolActionClickEvent(parentText, text)) |
|
52 |
deleteSymbolAction.triggered.connect(lambda: self.deleteSymbolActionClickEvent(sym.getType(), text)) |
|
55 | 53 |
menu.addAction(deleteSymbolAction) |
56 | 54 |
menu.exec_(self.viewport().mapToGlobal(position)) |
57 | 55 |
|
58 | 56 |
def editSymbolActionClickEvent(self, item, columNo): |
59 | 57 |
self.showSymbolEditorDialog(item, columNo) |
60 | 58 |
|
61 |
def displaySymbolActionClickEvent(self, itemName): |
|
59 |
def displaySymbolActionClickEvent(self, itemType, itemName):
|
|
62 | 60 |
project = AppDocData.instance().getCurrentProject() |
63 |
image = QImage(project.getImageFilePath()+"/"+itemName, "PNG") #itemName includes ".png" |
|
61 |
image = QImage(project.getImageFilePath()+"/"+itemType+"/"+itemName, "PNG") #itemName includes ".png"
|
|
64 | 62 |
dialog = QSymbolDisplayDialog.QSymbolDisplayDialog(image) |
65 | 63 |
dialog.showDialog() |
66 | 64 |
|
내보내기 Unified diff