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

A reusable widget which displays a summary of the results from a QgsAbstractValidityCheck (or checks). More...

#include <qgsvaliditycheckresultswidget.h>

Inheritance diagram for QgsValidityCheckResultsWidget:
Inheritance graph
[legend]

Public Member Functions

 QgsValidityCheckResultsWidget (QWidget *parent)
 Constructor for QgsValidityCheckResultsWidget, with the specified parent widget. More...
 
void setDescription (const QString &description)
 Sets a description label to show at the top of the widget, e.g. More...
 
void setResults (const QList< QgsValidityCheckResult > &results)
 Sets the list of check results to show in the dialog. More...
 

Static Public Member Functions

static bool runChecks (int type, const QgsValidityCheckContext *context, const QString &title, const QString &description, QWidget *parent=nullptr)
 Runs all registered validity checks of the given type, and if any warnings or critical errors are encountered then displays them to users in a dialog. More...
 

Detailed Description

A reusable widget which displays a summary of the results from a QgsAbstractValidityCheck (or checks).

Since
QGIS 3.6

Definition at line 70 of file qgsvaliditycheckresultswidget.h.

Constructor & Destructor Documentation

◆ QgsValidityCheckResultsWidget()

QgsValidityCheckResultsWidget::QgsValidityCheckResultsWidget ( QWidget *  parent)

Constructor for QgsValidityCheckResultsWidget, with the specified parent widget.

Definition at line 96 of file qgsvaliditycheckresultswidget.cpp.

Member Function Documentation

◆ runChecks()

bool QgsValidityCheckResultsWidget::runChecks ( int  type,
const QgsValidityCheckContext context,
const QString &  title,
const QString &  description,
QWidget *  parent = nullptr 
)
static

Runs all registered validity checks of the given type, and if any warnings or critical errors are encountered then displays them to users in a dialog.

The context argument must specify the correct QgsValidityCheckContext subclass for the given check type.

The title argument is used as the dialog's title, and the description text will be shown to users as an explanation of why the checks are being run.

The parent argument can be used to give a parent widget for the created dialogs.

If any critical errors are encountered by the checks, then users will not be allowed to click OK on the dialog and proceed with the operation. The function will return false.

Returns true if no warnings were encountered (and no dialog was shown to users), or if only warnings were shown and the user clicked OK after being shown these warnings.

This method is a blocking method, and runs all checks in the main thread.

Definition at line 130 of file qgsvaliditycheckresultswidget.cpp.

◆ setDescription()

void QgsValidityCheckResultsWidget::setDescription ( const QString &  description)

Sets a description label to show at the top of the widget, e.g.

notifying users of why they are being shown the warnings.

Definition at line 124 of file qgsvaliditycheckresultswidget.cpp.

◆ setResults()

void QgsValidityCheckResultsWidget::setResults ( const QList< QgsValidityCheckResult > &  results)

Sets the list of check results to show in the dialog.

Definition at line 103 of file qgsvaliditycheckresultswidget.cpp.


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