QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsLayoutNorthArrowValidityCheck Class Reference

Layout north arrow validity check. More...

#include <qgslayoutvaliditychecks.h>

Inheritance diagram for QgsLayoutNorthArrowValidityCheck:
Inheritance graph
[legend]

Public Member Functions

int checkType () const override
 Returns the type of the check. More...
 
QgsLayoutNorthArrowValidityCheckcreate () const override
 constructor More...
 
QString id () const override
 Returns the unique ID of the check. More...
 
bool prepareCheck (const QgsValidityCheckContext *context, QgsFeedback *feedback) override
 Prepares the check for execution, and returns true if the check can be run. More...
 
QList< QgsValidityCheckResultrunCheck (const QgsValidityCheckContext *context, QgsFeedback *feedback) override
 Runs the check and returns a list of results. More...
 
- Public Member Functions inherited from QgsAbstractValidityCheck
virtual ~QgsAbstractValidityCheck ()=default
 
virtual int checkType () const =0
 Returns the type of the check. More...
 
virtual QgsAbstractValidityCheckcreate () const =0
 Creates a new instance of the check and returns it. More...
 
virtual QString id () const =0
 Returns the unique ID of the check. More...
 
virtual bool prepareCheck (const QgsValidityCheckContext *context, QgsFeedback *feedback)
 Prepares the check for execution, and returns true if the check can be run. More...
 
virtual QList< QgsValidityCheckResultrunCheck (const QgsValidityCheckContext *context, QgsFeedback *feedback)=0
 Runs the check and returns a list of results. More...
 

Additional Inherited Members

- Public Types inherited from QgsAbstractValidityCheck
enum class  Type : int { LayoutCheck = 0 , UserCheck = 10000 }
 Check types. More...
 

Detailed Description

Layout north arrow validity check.

Note
This class is not a part of public API
Since
QGIS 3.12

Definition at line 55 of file qgslayoutvaliditychecks.h.

Member Function Documentation

◆ checkType()

int QgsLayoutNorthArrowValidityCheck::checkType ( ) const
overridevirtual

Returns the type of the check.

Implements QgsAbstractValidityCheck.

Definition at line 92 of file qgslayoutvaliditychecks.cpp.

◆ create()

QgsLayoutNorthArrowValidityCheck * QgsLayoutNorthArrowValidityCheck::create ( ) const
overridevirtual

constructor

Implements QgsAbstractValidityCheck.

Definition at line 82 of file qgslayoutvaliditychecks.cpp.

◆ id()

QString QgsLayoutNorthArrowValidityCheck::id ( ) const
overridevirtual

Returns the unique ID of the check.

This is a non-translated, non-user visible string identifying the check.

Implements QgsAbstractValidityCheck.

Definition at line 87 of file qgslayoutvaliditychecks.cpp.

◆ prepareCheck()

bool QgsLayoutNorthArrowValidityCheck::prepareCheck ( const QgsValidityCheckContext context,
QgsFeedback feedback 
)
overridevirtual

Prepares the check for execution, and returns true if the check can be run.

This method is always called from the main thread, and subclasses can implement it to do preparatory steps which are not thread safe (e.g. obtaining feature sources from vector layers). It is followed by a call to runCheck(), which may be performed in a background thread.

Individual calls to prepareCheck()/runCheck() are run on a new instance of the check (see create()), so subclasses can safely store state from the prepareCheck() method ready for the subsequent runCheck() method.

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

Reimplemented from QgsAbstractValidityCheck.

Definition at line 97 of file qgslayoutvaliditychecks.cpp.

◆ runCheck()

QList< QgsValidityCheckResult > QgsLayoutNorthArrowValidityCheck::runCheck ( const QgsValidityCheckContext context,
QgsFeedback feedback 
)
overridevirtual

Runs the check and returns a list of results.

If the check is "passed" and no warnings or errors are generated, then an empty list should be returned.

This method may be called in a background thread, so subclasses should take care to ensure that only thread-safe methods are used. It is always preceded by a call to prepareCheck().

If a check needs to perform non-thread-safe tests, these should be implemented within prepareCheck() and stored in the subclass instance to be returned by this method.

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

Implements QgsAbstractValidityCheck.

Definition at line 129 of file qgslayoutvaliditychecks.cpp.


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