Skip to content

Commit

Permalink
Fix graph view adding N-D entities traceback (#2777)
Browse files Browse the repository at this point in the history
  • Loading branch information
PiispaH authored May 16, 2024
1 parent 2e3ca53 commit fc9a23b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spinetoolbox/spine_db_editor/graphics_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,9 @@ def refresh_icon(self):
dimension_name_list = tuple(
el_item.entity_class_name for el_item in el_items if not isinstance(el_item, CrossHairsItem)
)
self._renderer = self.db_mngr.get_icon_mngr(self.first_db_map).multi_class_renderer(dimension_name_list)
self._renderer = self.db_mngr.get_icon_mngr(self.first_db_map).multi_class_renderer(
None, dimension_name_list, None
)
self._install_renderer()

def contextMenuEvent(self, e):
Expand Down
9 changes: 9 additions & 0 deletions spinetoolbox/spine_db_icon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ def _create_class_renderer(self, class_name):
self._class_renderers[class_name] = self.icon_renderer(chr(icon_code), color_code)

def _create_multi_class_renderer(self, name, dimension_name_list, id_):
if not any(dimension_name_list):
self._multi_class_renderers[
(
name,
dimension_name_list,
id_,
)
] = self.icon_renderer("\uf1b3", 0)
return
font = QFont("Font Awesome 5 Free Solid")
scene = QGraphicsScene()
display_icon = self.display_icons.get(name, None)
Expand Down

0 comments on commit fc9a23b

Please sign in to comment.