2005-10-25 | paulb | raw files shortlog changelog graph | [project @ 2005-10-25 17:50:19 by paulb] Added a method which removes the contents of collections. | |
XSLForms/PyQt.py (file) |
1.1 --- a/XSLForms/PyQt.py Tue Oct 25 17:27:43 2005 +0000 1.2 +++ b/XSLForms/PyQt.py Tue Oct 25 17:50:19 2005 +0000 1.3 @@ -55,6 +55,13 @@ 1.4 if not set: 1.5 field.setCurrentItem(0) 1.6 1.7 + def reset_collection(self, field): 1.8 + layout = field.layout() 1.9 + for child in field.children(): 1.10 + if child is not layout: 1.11 + layout.remove(child) 1.12 + child.deleteLater() 1.13 + 1.14 class Factory: 1.15 1.16 "A widget factory helper class."