Class: QgsValidityCheckRegistry

class qgis.core.QgsValidityCheckRegistry

Bases: sip.wrapper

This class keeps a list of QgsAbstractValidityCheck checks which can be used when performing validity checks.

QgsValidityCheckRegistry is not usually directly created, but rather accessed through QgsApplication.validityCheckRegistry()

Methods

addCheck

Adds a check to the registry.

checks

Returns the list of available checks.

removeCheck

Removes a check from the registry.

runChecks

Runs all checks of the specified type and returns a list of results.

addCheck(self, check: QgsAbstractValidityCheck)

Adds a check to the registry. Ownership of the check is transferred to the registry.

Parameters

check (QgsAbstractValidityCheck) –

checks(self) → List[QgsAbstractValidityCheck]

Returns the list of available checks.

checks(self, type: int) -> List[QgsAbstractValidityCheck] Returns the list of all available checks of the matching type.

Return type

List[QgsAbstractValidityCheck]

removeCheck(self, check: QgsAbstractValidityCheck)

Removes a check from the registry. The check object is automatically deleted.

Parameters

check (QgsAbstractValidityCheck) –

runChecks(self, type: int, context: QgsValidityCheckContext, feedback: QgsFeedback) → List[QgsValidityCheckResult]

Runs all checks of the specified type and returns a list of results.

If all checks are “passed” and no warnings or errors are generated, then an empty list will be returned.

The context argument gives the wider in which the check is being run.

The feedback argument is used to give progress reports and to support cancellation of long-running checks.

This is a blocking call, which will run all matching checks in the main thread and only return when they have all completed.

Parameters
Return type

List[QgsValidityCheckResult]