QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | List of all members
QgsValidityCheckRegistry Class Reference

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

#include <qgsvaliditycheckregistry.h>

Public Member Functions

 QgsValidityCheckRegistry ()
 
 QgsValidityCheckRegistry (const QgsValidityCheckRegistry &rh)=delete
 QgsValidityCheckRegistry cannot be copied. More...
 
 ~QgsValidityCheckRegistry ()
 
void addCheck (QgsAbstractValidityCheck *check)
 Adds a check to the registry. More...
 
QList< const QgsAbstractValidityCheck * > checks () const
 Returns the list of available checks. More...
 
QList< const QgsAbstractValidityCheck * > checks (int type) const
 Returns the list of all available checks of the matching type. More...
 
QgsValidityCheckRegistryoperator= (const QgsValidityCheckRegistry &rh)=delete
 QgsValidityCheckRegistry cannot be copied. More...
 
void removeCheck (QgsAbstractValidityCheck *check)
 Removes a check from the registry. More...
 
QList< QgsValidityCheckResultrunChecks (int type, const QgsValidityCheckContext *context, QgsFeedback *feedback) const
 Runs all checks of the specified type and returns a list of results. More...
 

Detailed Description

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().

Since
QGIS 3.6

Definition at line 36 of file qgsvaliditycheckregistry.h.

Constructor & Destructor Documentation

◆ QgsValidityCheckRegistry() [1/2]

QgsValidityCheckRegistry::QgsValidityCheckRegistry ( )

Definition at line 19 of file qgsvaliditycheckregistry.cpp.

◆ ~QgsValidityCheckRegistry()

QgsValidityCheckRegistry::~QgsValidityCheckRegistry ( )

Definition at line 23 of file qgsvaliditycheckregistry.cpp.

◆ QgsValidityCheckRegistry() [2/2]

QgsValidityCheckRegistry::QgsValidityCheckRegistry ( const QgsValidityCheckRegistry rh)
delete

QgsValidityCheckRegistry cannot be copied.

Member Function Documentation

◆ addCheck()

void QgsValidityCheckRegistry::addCheck ( QgsAbstractValidityCheck check)

Adds a check to the registry.

Ownership of the check is transferred to the registry.

Definition at line 50 of file qgsvaliditycheckregistry.cpp.

◆ checks() [1/2]

QList< const QgsAbstractValidityCheck * > QgsValidityCheckRegistry::checks ( ) const

Returns the list of available checks.

Definition at line 28 of file qgsvaliditycheckregistry.cpp.

◆ checks() [2/2]

QList< const QgsAbstractValidityCheck * > QgsValidityCheckRegistry::checks ( int  type) const

Returns the list of all available checks of the matching type.

Definition at line 39 of file qgsvaliditycheckregistry.cpp.

◆ operator=()

QgsValidityCheckRegistry& QgsValidityCheckRegistry::operator= ( const QgsValidityCheckRegistry rh)
delete

QgsValidityCheckRegistry cannot be copied.

◆ removeCheck()

void QgsValidityCheckRegistry::removeCheck ( QgsAbstractValidityCheck check)

Removes a check from the registry.

The check object is automatically deleted.

Definition at line 55 of file qgsvaliditycheckregistry.cpp.

◆ runChecks()

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 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.

Definition at line 62 of file qgsvaliditycheckregistry.cpp.


The documentation for this class was generated from the following files: