Ejemplo n.º 1
0
 def __init__(self, path, treewidget, is_python=True):
     QTreeWidgetItem.__init__(self, treewidget, QTreeWidgetItem.Type)
     self.path = path
     self.setIcon(
         0, ima.icon('python') if is_python else ima.icon('TextFileIcon'))
     self.setToolTip(0, path)
     set_item_user_text(self, path)
Ejemplo n.º 2
0
 def __init__(self, path, treewidget, is_python=True):
     QTreeWidgetItem.__init__(self, treewidget, QTreeWidgetItem.Type)
     self.path = path
     self.setIcon(
         0, ima.icon('python') if is_python else ima.icon('TextFileIcon'))
     self.setToolTip(0, path)
     set_item_user_text(self, path)
Ejemplo n.º 3
0
 def update(self):
     """Update the tree element."""
     name = self.get_name()
     self.setText(0, name)
     parent_text = from_qvariant(self.parent_item.data(0, Qt.UserRole),
                                 to_text_string)
     set_item_user_text(self, parent_text + '/' + name)
     self.setup()
Ejemplo n.º 4
0
 def update_info(self, name, kind, position):
     self.setIcon(0, ima.icon(SYMBOL_KIND_ICON.get(kind, 'no_match')))
     identifier = SYMBOL_NAME_MAP.get(kind, '')
     identifier = identifier.replace('_', ' ').capitalize()
     self.setToolTip(
         0, '{3} {2}: {0} {1}'.format(identifier, name, position,
                                      _('Line')))
     set_item_user_text(self, name)
     self.setText(0, name)
Ejemplo n.º 5
0
 def __init__(self, name, line, parent, preceding):
     if preceding is None:
         QTreeWidgetItem.__init__(self, parent, QTreeWidgetItem.Type)
     else:
         if preceding is not parent:
             # Preceding must be either the same as item's parent
             # or have the same parent as item
             while preceding.parent() is not parent:
                 preceding = preceding.parent()
                 if preceding is None:
                     break
         if preceding is None:
             QTreeWidgetItem.__init__(self, parent, QTreeWidgetItem.Type)
         else:
             QTreeWidgetItem.__init__(self, parent, preceding,
                                      QTreeWidgetItem.Type)
     self.setText(0, name)
     parent_text = from_qvariant(parent.data(0, Qt.UserRole),
                                 to_text_string)
     set_item_user_text(self, parent_text + '/' + name)
     self.line = line
Ejemplo n.º 6
0
 def __init__(self, name, line, parent, preceding):
     if preceding is None:
         QTreeWidgetItem.__init__(self, parent, QTreeWidgetItem.Type)
     else:
         if preceding is not parent:
             # Preceding must be either the same as item's parent
             # or have the same parent as item
             while preceding.parent() is not parent:
                 preceding = preceding.parent()
                 if preceding is None:
                     break
         if preceding is None:
             QTreeWidgetItem.__init__(self, parent, QTreeWidgetItem.Type)
         else:
             QTreeWidgetItem.__init__(self, parent, preceding,
                                      QTreeWidgetItem.Type)
     self.setText(0, name)
     parent_text = from_qvariant(parent.data(0, Qt.UserRole),
                                 to_text_string)
     set_item_user_text(self, parent_text+'/'+name)
     self.line = line
Ejemplo n.º 7
0
 def set_item_data(self, item, filename, line_number):
     """Set tree item user data: filename (string) and line_number (int)"""
     set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))
Ejemplo n.º 8
0
 def __init__(self, path, treewidget):
     QTreeWidgetItem.__init__(self, treewidget, QTreeWidgetItem.Type)
     self.path = path
     self.setIcon(0, ima.icon('python'))
     self.setToolTip(0, path)
     set_item_user_text(self, path)
Ejemplo n.º 9
0
 def __init__(self, path, treewidget):
     QTreeWidgetItem.__init__(self, treewidget, QTreeWidgetItem.Type)
     self.path = path
     self.setIcon(0, ima.icon('python'))
     self.setToolTip(0, path)
     set_item_user_text(self, path)
Ejemplo n.º 10
0
 def set_item_data(self, item, filename, line_number):
     """Set tree item user data: filename (string) and line_number (int)"""
     set_item_user_text(item, '%s%s%d' % (filename, self.SEP, line_number))