Skip to content

Commit d9ce381

Browse files
authored
Merge pull request #368 from jchanvfx/node_property_window_bugfixes
node property window bug fixes.
2 parents 04a184d + f2ce4c2 commit d9ce381

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

NodeGraphQt/pkg_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
3-
__version__ = '0.6.14'
3+
__version__ = '0.6.15'
44
__status__ = 'Work in Progress'
55
__license__ = 'MIT'
66

0 commit comments

Comments
 (0)