예제 #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 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)
예제 #3
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)
예제 #4
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)
예제 #5
0
 def add_to_state(item):
     user_text = get_item_user_text(item)
     self.__expanded_state[hash(user_text)] = item.isExpanded()
예제 #6
0
 def add_to_state(item):
     user_text = get_item_user_text(item)
     self.__expanded_state[hash(user_text)] = item.isExpanded()