diff --git a/NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py b/NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py index 7a0cef3d..6ab31ca4 100644 --- a/NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py +++ b/NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py @@ -447,15 +447,25 @@ def _read_node(self, node): ports_container = _PortConnectionsContainer(self, node=node) self.__tab.addTab(ports_container, 'Ports') - # hide empty tabs with no property widgets. + # hide/remove empty tabs with no property widgets. tab_index = { self.__tab.tabText(x): x for x in range(self.__tab.count()) } + current_idx = None for tab_name, prop_window in self.__tab_windows.items(): prop_widgets = prop_window.get_all_widgets() if not prop_widgets: - self.__tab.setTabVisible(tab_index[tab_name], False) - self.__tab.setCurrentWidget(prop_window) + # I prefer to hide the tab but in older version of pyside this + # attribute doesn't exist we'll just remove. + if hasattr(self.__tab, 'setTabVisible'): + self.__tab.setTabVisible(tab_index[tab_name], False) + else: + self.__tab.removeTab(tab_index[tab_name]) + continue + if current_idx is None: + current_idx = tab_index[tab_name] + + self.__tab.setCurrentIndex(current_idx) return ports_container @@ -584,8 +594,8 @@ def __init__(self, parent=None, node_graph=None): self.resize(450, 400) # this attribute to block signals if for the "on_property_changed" signal - # in case devs that don't implemented the ".prop_widgets_abstract.BaseProperty" - # widget is not implemented properly to prevent infinite loop. + # in case devs that don't implement the ".prop_widgets_abstract.BaseProperty" + # widget properly to prevent an infinite loop. self._block_signal = False self._lock = False diff --git a/NodeGraphQt/pkg_info.py b/NodeGraphQt/pkg_info.py index e4d1ff2d..b691d946 100644 --- a/NodeGraphQt/pkg_info.py +++ b/NodeGraphQt/pkg_info.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -__version__ = '0.6.14' +__version__ = '0.6.15' __status__ = 'Work in Progress' __license__ = 'MIT'