def selectItem(self): """Open a list of items to replace the current one.""" if self._db: from wic import forms, getObjectByPath model = getObjectByPath(self._model) db = self._item._db if self._item else self._db catalogForm = forms.openCatalogForm(model, db, type = 1) catalogForm.itemSelected.connect(self.setItem)
def openForm(FormClass, *args, modal=False, **kwargs): if isinstance(FormClass, str): FormClass = wic.getObjectByPath(FormClass) assert issubclass(FormClass, WForm), "This is not a WForm." form = FormClass(*args, **kwargs) # no parent widget for now if modal: return form.exec() wic.app.addSubWindow(form) return form