개정판 8c8887e4
issue #1351: fix symbol tree change
Change-Id: I4b657e0993217c054e7e1efbd6ed44afbe2f356f
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
2087 | 2087 |
dlg.show() |
2088 | 2088 |
elif event.key() == Qt.Key_I: |
2089 | 2089 |
# insert symbol item that is selected symbol in tree to main window if symbol already selected on main window, replace |
2090 |
items = self.symbolTreeWidget.selectedItems() |
|
2090 |
index = self.symbolTreeWidget.currentIndex() |
|
2091 |
proxy_model = self.symbolTreeWidget.model() |
|
2092 |
items = [proxy_model.sourceModel().itemFromIndex(proxy_model.mapToSource(index))] |
|
2091 | 2093 |
if items and hasattr(items[0], 'svgFilePath'): |
2092 |
symData = items[0].data(0, self.symbolTreeWidget.TREE_DATA_ROLE)
|
|
2094 |
symData = items[0].data(self.symbolTreeWidget.TREE_DATA_ROLE) |
|
2093 | 2095 |
symName = symData.getName() |
2094 | 2096 |
else: |
2095 | 2097 |
return |
... | ... | |
2116 | 2118 |
return |
2117 | 2119 |
elif event.key() == Qt.Key_J: |
2118 | 2120 |
# insert and connect symbol item that is selected symbol in tree to selected symbol |
2119 |
items = self.symbolTreeWidget.selectedItems() |
|
2121 |
index = self.symbolTreeWidget.currentIndex() |
|
2122 |
proxy_model = self.symbolTreeWidget.model() |
|
2123 |
items = [proxy_model.sourceModel().itemFromIndex(proxy_model.mapToSource(index))] |
|
2120 | 2124 |
if items and hasattr(items[0], 'svgFilePath'): |
2121 |
symData = items[0].data(0, self.symbolTreeWidget.TREE_DATA_ROLE)
|
|
2125 |
symData = items[0].data(self.symbolTreeWidget.TREE_DATA_ROLE) |
|
2122 | 2126 |
symName = symData.getName() |
2123 | 2127 |
else: |
2124 | 2128 |
return |
내보내기 Unified diff