API Documentation

DdManager

class ddmanager.DdManager(iface)[source]

DdManager manages all masks in the current project

addAction(layer, actionName=u'showDdForm', ddManagerName='ddManager')[source]

api method to add an action to the layer with a self defined name

initLayer(layer, skip=[], labels={}, fieldOrder=[], fieldGroups={}, minMax={}, noSearchFields=[], showParents=True, createAction=True, db=None, inputMask=True, searchMask=True, inputUi=None, searchUi=None, helpText='', fieldDisable=[])[source]

api method initLayer: initialize this layer with a data-driven input mask. In case there is configuration for this layer in the database read this configuration and apply what is provided there. Returns a Boolean stating the success of the initialization Parameters: WARNING: if config tables are used, the parameters’ objects survive and are thus applied to the next layer, too. Be sure to also pass ALL optional paramerters when calling initLayer()

  • layer [QgsVectorLayer]
  • skip [array [string]]: field names to not show
  • labels [dict] with entries: “fieldname”: “label”
  • fieldOrder [array[string]]: containing the field names in the order they should be shown
  • fieldGroups [dict] with entries: fieldName: [tabTitle, tabTooltip] for each group a tab is created and the fields from fieldName onwards (refers to fieldOrder) are grouped in this tab; tabTooltip is optional
  • minMax [dict] with entries: “fieldname”: [min, max] - strings; use for numerical or date fields only!
  • noSearchFields [array[string]] with fields not to be shown in the search form, if empty all fields are shown. Skipped fields are never shown in the search form, no matter if they are included here
  • showParents [Boolean] show tabs for 1-to-1 relations (parents)
  • createAction [Boolean]: add an action to the layer’s list of actions
  • db [QtSql.QSqlDatabase]
  • inputMask [Boolean]: create a data-edit mask
  • searchMask [Boolean]: create a data-search mask
  • inputUi [ddui.DdDialogWidget]: apply this inputUi
  • searchUi [ddui.DdDialogWidget]: apply this as search ui
  • helpText [string] help text for this mask, may be html formatted
  • fieldDisable [array[string]]: field names whose DdInputWidget shall be disabled in the inputMask
removeAction(layer, actionName)[source]

api method to remove an action from the layer

setDb(layer, db)[source]

api method to set the db for a layer

setUi(layer, ui, searchUi=None, showParents=None, thisSize=None)[source]

api method to exchange the default ui with a custom ui

showFeatureForm(layer, feature, showParents=True, title=None, askForSave=True, multiEdit=False)[source]

api method showFeatureForm: show the data-driven input mask for a layer and a feature if the data provider allows editing the layer is turned into editing mode if the user clicks OK all changes to the feature are committed (no undo!) if askForSave is true and the layer has pending changes the user is asked if the changes shall be commited before the mask is opened if multiEdit is True then the changes are applied to all selected Features in the layer returns 1 if user clicked OK, 0 if CANCEL