mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-26 00:02:08 -05:00
Adds a new interface QgsAbstractValidityCheck which defines a single "check" which can be performed on a given QgsValidityCheckContext. A new application-wide QgsValidityCheckRegistry registers and manages instances of all known checks, and allows running of all registered checks of a specific type at once. Initially the framework is focused toward print layout validity checks, but the interface has been designed to be generic enough to allow alternative types of validity checks (e.g. project save validity checks, processing model validity checks, etc.). The API is designed to be used both by internal validity checks and also to be extended by custom, organisation-specific validity checks. E.g., for print layout validity checks we could have:
62 lines
2.1 KiB
Plaintext
62 lines
2.1 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/validity/qgsvaliditycheckcontext.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
class QgsValidityCheckContext
|
|
{
|
|
%Docstring
|
|
Base class for validity check contexts.
|
|
|
|
QgsAbstractValidityCheck subclasses are passed a QgsValidityCheckContext subclass which
|
|
encapsulates the context around that particular check type. For instance, a QgsAbstractValidityCheck
|
|
of the QgsAbstractValidityCheck.TypeLayoutCheck type will be passed a QgsLayoutValidityCheckContext
|
|
context, containing a reference to the QgsLayout to be checked.
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsvaliditycheckcontext.h"
|
|
%End
|
|
public:
|
|
|
|
};
|
|
|
|
class QgsLayoutValidityCheckContext : QgsValidityCheckContext
|
|
{
|
|
%Docstring
|
|
Validity check context for print layout validation.
|
|
|
|
QgsLayoutValidityCheckContext are passed to QgsAbstractValidityCheck subclasses which
|
|
indicate they are of the QgsAbstractValidityCheck.TypeLayoutCheck type.
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsvaliditycheckcontext.h"
|
|
%End
|
|
public:
|
|
|
|
QgsLayoutValidityCheckContext( QgsLayout *layout );
|
|
%Docstring
|
|
Constructor for QgsLayoutValidityCheckContext for the specified ``layout``.
|
|
%End
|
|
|
|
QgsLayout *layout;
|
|
|
|
};
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/validity/qgsvaliditycheckcontext.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|