Class: QgsValidityCheckRegistry¶
A registry that 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()
.
Added in version 3.6.
Methods
Adds a check to the registry. |
|
Returns the list of available checks. |
|
Removes a check from the registry. |
|
Runs all checks of the specified type and returns a list of results. |
- class qgis.core.QgsValidityCheckRegistry[source]¶
Bases:
object
- addCheck(self, check: QgsAbstractValidityCheck | None)[source]¶
Adds a
check
to the registry. Ownership of the check is transferred to the registry.- Parameters:
check (Optional[QgsAbstractValidityCheck])
- checks(self) List[QgsAbstractValidityCheck] ¶
Returns the list of available checks.
- Return type:
List[QgsAbstractValidityCheck]
- checks(self, type: int) List[QgsAbstractValidityCheck]
Returns the list of all available checks of the matching
type
.- Parameters:
type (int)
- Return type:
List[QgsAbstractValidityCheck]
- removeCheck(self, check: QgsAbstractValidityCheck | None)[source]¶
Removes a
check
from the registry. The check object is automatically deleted.- Parameters:
check (Optional[QgsAbstractValidityCheck])
- runChecks(self, type: int, context: QgsValidityCheckContext | None, feedback: QgsFeedback | None) 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:
type (int)
context (Optional[QgsValidityCheckContext])
feedback (Optional[QgsFeedback])
- Return type:
List[QgsValidityCheckResult]