66 ) |
66 ) |
67 self.__astWidget.setSelectionMode( |
67 self.__astWidget.setSelectionMode( |
68 QAbstractItemView.SelectionMode.SingleSelection |
68 QAbstractItemView.SelectionMode.SingleSelection |
69 ) |
69 ) |
70 self.__astWidget.setAlternatingRowColors(True) |
70 self.__astWidget.setAlternatingRowColors(True) |
|
71 self.__astWidget.setExpandsOnDoubleClick(False) |
71 |
72 |
72 self.__errorColor = QBrush(Preferences.getPython("ASTViewerErrorColor")) |
73 self.__errorColor = QBrush(Preferences.getPython("ASTViewerErrorColor")) |
73 |
74 |
74 self.__astWidget.itemClicked.connect(self.__astItemClicked) |
75 self.__astWidget.itemClicked.connect(self.__astItemClicked) |
75 |
76 |
99 @type Editor |
100 @type Editor |
100 """ |
101 """ |
101 if editor and editor is self.__editor: |
102 if editor and editor is self.__editor: |
102 self.__loadAST() |
103 self.__loadAST() |
103 |
104 |
104 def __editorDoubleClicked(self, editor, pos, buttons): |
105 def __editorDoubleClicked(self, editor, pos, buttons): # noqa: U100 |
105 """ |
106 """ |
106 Private slot to handle a mouse button double click in the editor. |
107 Private slot to handle a mouse button double click in the editor. |
107 |
108 |
108 @param editor reference to the editor, that emitted the signal |
109 @param editor reference to the editor, that emitted the signal |
109 @type Editor |
110 @type Editor |
110 @param pos position of the double click |
111 @param pos position of the double click |
111 @type QPoint |
112 @type QPoint |
112 @param buttons mouse buttons that were double clicked |
113 @param buttons mouse buttons that were double clicked |
113 @type Qt.MouseButtons |
114 @type Qt.MouseButton |
114 """ |
115 """ |
115 if editor is self.__editor and buttons == Qt.MouseButton.LeftButton: |
116 if editor is self.__editor and buttons == Qt.MouseButton.LeftButton: |
116 if editor.isModified(): |
117 if editor.isModified(): |
117 # reload the source |
118 # reload the source |
118 QTimer.singleShot(0, self.__loadAST) |
119 QTimer.singleShot(0, self.__loadAST) |