Skip to content
Permalink
Browse files

[pyqgis-console] shows also derived class name in object browser widget

  • Loading branch information
slarosa committed Apr 22, 2013
1 parent 4696e01 commit 12a8390ea357bc0775f5456286fdeeeb3808dcc2
Showing with 15 additions and 2 deletions.
  1. +15 −2 python/console/console_editor.py
@@ -763,14 +763,27 @@ def listObject(self, tab):
try:
reload(pyclbr)
dictObject = {}
superClassName = []
readModule = pyclbr.readmodule(module)
readModuleFunction = pyclbr.readmodule_ex(module)
for name, class_data in sorted(readModule.items(), key=lambda x:x[1].lineno):
if class_data.file == tabWidget.path:
for superClass in class_data.super:
if superClass == 'object':
continue
if isinstance(superClass, basestring):
superClassName.append(superClass)
else:
superClassName.append(superClass.name)
classItem = QTreeWidgetItem()
classItem.setText(0, name)
if superClassName:
for i in superClassName: super = i
classItem.setText(0, name + ' [' + super + ']')
classItem.setToolTip(0, name + ' [' + super + ']')
else:
classItem.setText(0, name)
classItem.setToolTip(0, name)
classItem.setText(1, str(class_data.lineno))
classItem.setToolTip(0, name)
classItem.setIcon(0, QgsApplication.getThemeIcon("console/iconClassTreeWidgetConsole.png"))
dictObject[name] = class_data.lineno
for meth, lineno in sorted(class_data.methods.items(), key=itemgetter(1)):

0 comments on commit 12a8390

Please sign in to comment.
You can’t perform that action at this time.