# HG changeset patch # User paulb # Date 1130262619 0 # Node ID 2b2b93f32e2b005e9803b1f37d46cdeaf6f351e6 # Parent 83ce900fe957f5770fda7aacbd64716072d282ec [project @ 2005-10-25 17:50:19 by paulb] Added a method which removes the contents of collections. diff -r 83ce900fe957 -r 2b2b93f32e2b XSLForms/PyQt.py --- a/XSLForms/PyQt.py Tue Oct 25 17:27:43 2005 +0000 +++ b/XSLForms/PyQt.py Tue Oct 25 17:50:19 2005 +0000 @@ -55,6 +55,13 @@ if not set: field.setCurrentItem(0) + def reset_collection(self, field): + layout = field.layout() + for child in field.children(): + if child is not layout: + layout.remove(child) + child.deleteLater() + class Factory: "A widget factory helper class."