def _on_item_new_state(self, item: QtWidgets.QTreeWidgetItem,
                        new_state: bool):
     uid = item.data(0, Qt.UserRole)
     if uid is None:
         game = self._find_game_for_root_item(item)
         with self.options as options:
             options.set_is_game_expanded(game, new_state)
     else:
         with self.options as options:
             options.set_preset_uuid_hidden(uid, not new_state)
Beispiel #2
0
 def preset_for_item(
         self,
         item: QtWidgets.QTreeWidgetItem) -> Optional[VersionedPreset]:
     return self.window_manager.preset_manager.preset_for_uuid(
         item.data(0, Qt.UserRole))