diff -r b3929f6748ae -r fcae57045733 src/eric7/QScintilla/EditorOutlineModel.py --- a/src/eric7/QScintilla/EditorOutlineModel.py Tue Jan 02 14:06:09 2024 +0100 +++ b/src/eric7/QScintilla/EditorOutlineModel.py Tue Jan 02 16:08:13 2024 +0100 @@ -25,6 +25,7 @@ BrowserModel, ) from eric7.Utilities import ClassBrowsers +from eric7.Utilities.ClassBrowsers import ClbrBaseClasses class EditorOutlineModel(BrowserModel): @@ -75,28 +76,32 @@ self.__editor.text(), self.__filename, self.__module ) if dictionary is not None: - keys = list(dictionary) - if len(keys) > 0: + if len(dictionary) > 0: parentItem = self.rootItem if repopulate: - last = len(keys) - 1 - if "@@Coding@@" in keys and not Preferences.getEditor( + last = len(dictionary) - 1 + if "@@Coding@@" in dictionary and not Preferences.getEditor( "SourceOutlineShowCoding" ): last -= 1 self.beginInsertRows(QModelIndex(), 0, last) - for key in keys: + for key in dictionary: if key.startswith("@@"): # special treatment done later continue cl = dictionary[key] with contextlib.suppress(AttributeError): if cl.module == self.__module: - node = BrowserClassItem(parentItem, cl, self.__filename) + if isinstance(cl, ClbrBaseClasses.Class): + node = BrowserClassItem(parentItem, cl, self.__filename) + elif isinstance(cl, ClbrBaseClasses.Function): + node = BrowserMethodItem( + parentItem, cl, self.__filename + ) self._addItem(node, parentItem) - if "@@Coding@@" in keys and Preferences.getEditor( + if "@@Coding@@" in dictionary and Preferences.getEditor( "SourceOutlineShowCoding" ): node = BrowserCodingItem( @@ -107,20 +112,20 @@ dictionary["@@Coding@@"].linenumber, ) self._addItem(node, parentItem) - if "@@Globals@@" in keys: + if "@@Globals@@" in dictionary: node = BrowserGlobalsItem( parentItem, dictionary["@@Globals@@"].globals, QCoreApplication.translate("EditorOutlineModel", "Globals"), ) self._addItem(node, parentItem) - if "@@Import@@" in keys or "@@ImportFrom@@" in keys: + if "@@Import@@" in dictionary or "@@ImportFrom@@" in dictionary: node = BrowserImportsItem( parentItem, QCoreApplication.translate("EditorOutlineModel", "Imports"), ) self._addItem(node, parentItem) - if "@@Import@@" in keys: + if "@@Import@@" in dictionary: for importedModule in ( dictionary["@@Import@@"].getImports().values() ):