QgsValidityCheckResultsWidget class

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

Public static functions

static auto runChecks(int type, const QgsValidityCheckContext* context, const QString& title, const QString& description, QWidget* parent = nullptr) -> bool
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.

Constructors, destructors, conversion operators

QgsValidityCheckResultsWidget(QWidget* parent)
Constructor for QgsValidityCheckResultsWidget, with the specified parent widget.

Public functions

void setDescription(const QString& description)
Sets a description label to show at the top of the widget, e.g.
void setResults(const QList<QgsValidityCheckResult>& results)
Sets the list of check results to show in the dialog.

Function documentation

static bool QgsValidityCheckResultsWidget::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.

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.

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.