(self, options=None)
options: name, valType, label, defaultValue
options: name, valType, label, defaultValue
options : name valType label defaultValue
def setup(self, options=None):
        """ options: name, valType, label, defaultValue """
        options = options or {}
        valType = options.get("valType", WVT.SIZE)

        if valType == self.valType:
            val = self.widget.expression.expression()
        else:
            val = str(options.get("defVal", 0))
            self.valType = valType

        WidgetFuncBase.setup(self, editLabel=options.get("name", ""), lineEdit=val)

        self.widget.comboBox.clear()
        self.widget.comboBox.addItem("Expression")

        self.widget.expression.setFilters(QgsFieldProxyModel.Numeric)
        self.widget.expression.setLayer(self.mapLayer)
def setup ( self , options = None ) : options = options or { } valType = options . get ( "valType" , WVT . SIZE ) if valType == self . valType : val = self . widget . expression . expression ( ) else : val = str ( options . get ( "defVal" , 0 ) ) self . valType = valType WidgetFuncBase . setup ( self , editLabel = options . get ( "name" , "" ) , lineEdit = val ) self . widget . comboBox . clear ( ) self . widget . comboBox . addItem ( "Expression" ) self . widget . expression . setFilters ( QgsFieldProxyModel . Numeric ) self . widget . expression . setLayer ( self . mapLayer )