Class: QgsProcessingParameterMatrix

class qgis.core.QgsProcessingParameterMatrix

Bases: QgsProcessingParameterDefinition

A table (matrix) parameter for processing algorithms.

New in version 3.0.

QgsProcessingParameterMatrix(name: str, description: str = ‘’, numberRows: int = 3, hasFixedNumberRows: bool = False, headers: Iterable[str] = [], defaultValue: Any = None, optional: bool = False) Constructor for QgsProcessingParameterMatrix.

QgsProcessingParameterMatrix(QgsProcessingParameterMatrix)

Methods

asPythonString

param outputType

checkValueIsAcceptable

param input

clone

rtype

QgsProcessingParameterDefinition

fromScriptCode

Creates a new parameter using the definition from a script code.

fromVariantMap

param map

hasFixedNumberRows

Returns whether the table has a fixed number of rows.

headers

Returns a list of column headers (if set).

numberRows

Returns the fixed number of rows in the table.

setHasFixedNumberRows

Sets whether the table has a fixed number of rows.

setHeaders

Sets the list of column headers.

setNumberRows

Sets the fixed number of rows in the table.

toVariantMap

rtype

Dict[str, Any]

type

rtype

str

typeName

Returns the type name for the parameter class.

valueAsPythonString

param value

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass)str
Parameters

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonQgsProcessingAlgorithmSubclass) –

Return type

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext = None)bool
Parameters
Return type

bool

clone(self)QgsProcessingParameterDefinition
Return type

QgsProcessingParameterDefinition

fromScriptCode(name: str, description: str, isOptional: bool, definition: str)QgsProcessingParameterMatrix

Creates a new parameter using the definition from a script code.

Parameters
  • name (str) –

  • description (str) –

  • isOptional (bool) –

  • definition (str) –

Return type

QgsProcessingParameterMatrix

fromVariantMap(self, map: Dict[str, Any])bool
Parameters

map (Dict[str) –

Return type

bool

hasFixedNumberRows(self)bool

Returns whether the table has a fixed number of rows.

See also

numberRows()

Return type

bool

headers(self)List[str]

Returns a list of column headers (if set).

See also

setHeaders()

Return type

List[str]

numberRows(self)int

Returns the fixed number of rows in the table. This parameter only has an effect if hasFixedNumberRows() is True.

See also

setNumberRows()

Return type

int

setHasFixedNumberRows(self, hasFixedNumberRows: bool)

Sets whether the table has a fixed number of rows.

See also

setNumberRows()

Parameters

hasFixedNumberRows (bool) –

setHeaders(self, headers: Iterable[str])

Sets the list of column headers.

See also

headers()

Parameters

headers (Iterable[str]) –

setNumberRows(self, rows: int)

Sets the fixed number of rows in the table. This parameter only has an effect if hasFixedNumberRows() is True.

See also

numberRows()

Parameters

rows (int) –

toVariantMap(self)Dict[str, Any]
Return type

Dict[str, Any]

type(self)str
Return type

str

typeName()str

Returns the type name for the parameter class.

Return type

str

valueAsPythonString(self, value: Any, context: QgsProcessingContext)str
Parameters
Return type

str