comparison cagou/core/cagou_main.py @ 351:e9d3c3793f94

core (Cagou): "None" can be used in getVisibleList's cls to get all visible widgets
author Goffi <goffi@goffi.org>
date Fri, 17 Jan 2020 18:44:35 +0100
parents 1ac40d3121f6
children 434f770fe55b
comparison
equal deleted inserted replaced
350:1ac40d3121f6 351:e9d3c3793f94
785 785
786 def getVisibleList(self, cls): 786 def getVisibleList(self, cls):
787 """get list of visible widgets for a given class 787 """get list of visible widgets for a given class
788 788
789 @param cls(type): type of widgets to get 789 @param cls(type): type of widgets to get
790 @return (list[type]): visible widgets of this class 790 None to get all visible widgets
791 """ 791 @return (set[type]): visible widgets of this class
792 """
793 if cls is None:
794 ret = set()
795 for widgets in self._visible_widgets.values():
796 for w in widgets:
797 ret.add(w)
798 return ret
792 try: 799 try:
793 return self._visible_widgets[cls] 800 return self._visible_widgets[cls]
794 except KeyError: 801 except KeyError:
795 return [] 802 return set()
796 803
797 def deleteUnusedWidgetInstances(self, widget): 804 def deleteUnusedWidgetInstances(self, widget):
798 """Delete instance of this widget without parent 805 """Delete instance of this widget without parent
799 806
800 @param widget(quick_widgets.QuickWidget): reference widget 807 @param widget(quick_widgets.QuickWidget): reference widget