QgsValidityCheckRegistry class
This class keeps a list of QgsAbstractValidityCheck checks which can be used when performing validity checks.
Contents
QgsValidityCheckRegistry is not usually directly created, but rather accessed through QgsApplication::
Constructors, destructors, conversion operators
- QgsValidityCheckRegistry(const QgsValidityCheckRegistry& rh) deleted
- QgsValidityCheckRegistry cannot be copied.
Public functions
- void addCheck(QgsAbstractValidityCheck* check)
- Adds a check to the registry.
- auto checks() const -> QList<const QgsAbstractValidityCheck*>
- Returns the list of available checks.
- auto checks(int type) const -> QList<const QgsAbstractValidityCheck*>
- Returns the list of all available checks of the matching type.
- auto operator=(const QgsValidityCheckRegistry& rh) -> QgsValidityCheckRegistry& deleted
- QgsValidityCheckRegistry cannot be copied.
- void removeCheck(QgsAbstractValidityCheck* check)
- Removes a check from the registry.
- auto runChecks(int type, const QgsValidityCheckContext* context, QgsFeedback* feedback) const -> QList<QgsValidityCheckResult>
- Runs all checks of the specified type and returns a list of results.
Function documentation
void QgsValidityCheckRegistry:: addCheck(QgsAbstractValidityCheck* check)
Adds a check to the registry.
Ownership of the check is transferred to the registry.
void QgsValidityCheckRegistry:: removeCheck(QgsAbstractValidityCheck* check)
Removes a check from the registry.
The check object is automatically deleted.
QList<QgsValidityCheckResult> QgsValidityCheckRegistry:: runChecks(int type,
const QgsValidityCheckContext* context,
QgsFeedback* feedback) const
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 cancelation 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.