[BIM] Fix error starting BIM Wb for certain new users

This commit is contained in:
Syres916
2024-09-24 11:49:24 +01:00
committed by Yorik van Havre
parent 7f44a0e4b2
commit 690d2196af

View File

@@ -267,11 +267,12 @@ class BIM_Views:
top = QtGui.QTreeWidgetItem([translate("BIM","2D Views"), ""])
top.setIcon(0, ficon)
for v in views:
i = QtGui.QTreeWidgetItem([v.Label, ""])
if hasattr(v.ViewObject, "Icon"):
i.setIcon(0, v.ViewObject.Icon)
i.setToolTip(0, v.Name)
top.addChild(i)
if hasattr(v, "Label"):
i = QtGui.QTreeWidgetItem([v.Label, ""])
if hasattr(v.ViewObject, "Icon"):
i.setIcon(0, v.ViewObject.Icon)
i.setToolTip(0, v.Name)
top.addChild(i)
vm.tree.addTopLevelItem(top)
# add pages