示例#1
0
 def browse_children(item):
     add_to_state(item)
     for index in range(item.childCount()):
         citem = item.child(index)
         user_text = get_item_user_text(citem)
         self.__expanded_state[hash(user_text)] = citem.isExpanded()
         browse_children(citem)
示例#2
0
 def restore_expanded_state(self):
     """Restore all items expanded state"""
     if self.__expanded_state is None:
         return
     for item in self.get_items()+self.get_top_level_items():
         user_text = get_item_user_text(item)
         is_expanded = self.__expanded_state.get(hash(user_text))
         if is_expanded is not None:
             item.setExpanded(is_expanded)
示例#3
0
 def get_item_data(self, item):
     """Get tree item user data: (filename, line_number)"""
     filename, line_number_str = get_item_user_text(item).split(self.SEP)
     return filename, int(line_number_str)
示例#4
0
 def add_to_state(item):
     user_text = get_item_user_text(item)
     self.__expanded_state[hash(user_text)] = item.isExpanded()
示例#5
0
 def get_item_data(self, item):
     """Get tree item user data: (filename, line_number)"""
     filename, line_number_str = get_item_user_text(item).split(self.SEP)
     return filename, int(line_number_str)