@@ -447,15 +447,25 @@ def _read_node(self, node):
447447 ports_container = _PortConnectionsContainer (self , node = node )
448448 self .__tab .addTab (ports_container , 'Ports' )
449449
450- # hide empty tabs with no property widgets.
450+ # hide/remove empty tabs with no property widgets.
451451 tab_index = {
452452 self .__tab .tabText (x ): x for x in range (self .__tab .count ())
453453 }
454+ current_idx = None
454455 for tab_name , prop_window in self .__tab_windows .items ():
455456 prop_widgets = prop_window .get_all_widgets ()
456457 if not prop_widgets :
457- self .__tab .setTabVisible (tab_index [tab_name ], False )
458- self .__tab .setCurrentWidget (prop_window )
458+ # I prefer to hide the tab but in older version of pyside this
459+ # attribute doesn't exist we'll just remove.
460+ if hasattr (self .__tab , 'setTabVisible' ):
461+ self .__tab .setTabVisible (tab_index [tab_name ], False )
462+ else :
463+ self .__tab .removeTab (tab_index [tab_name ])
464+ continue
465+ if current_idx is None :
466+ current_idx = tab_index [tab_name ]
467+
468+ self .__tab .setCurrentIndex (current_idx )
459469
460470 return ports_container
461471
@@ -584,8 +594,8 @@ def __init__(self, parent=None, node_graph=None):
584594 self .resize (450 , 400 )
585595
586596 # this attribute to block signals if for the "on_property_changed" signal
587- # in case devs that don't implemented the ".prop_widgets_abstract.BaseProperty"
588- # widget is not implemented properly to prevent infinite loop.
597+ # in case devs that don't implement the ".prop_widgets_abstract.BaseProperty"
598+ # widget properly to prevent an infinite loop.
589599 self ._block_signal = False
590600
591601 self ._lock = False
0 commit comments