Class: QgsValidityCheckResultsWidget¶
A reusable widget which displays a summary of the results from a
QgsAbstractValidityCheck (or checks).
Added in version 3.6.
Class Hierarchy¶
Base classes¶
Methods
Sets a description label to show at the top of the widget, e.g. notifying users of why they are being shown the warnings. |
|
Sets the list of check results to show in the dialog. |
Static Methods
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. |
- class qgis.gui.QgsValidityCheckResultsWidget[source]¶
Bases:
QWidget- __init__(parent: QWidget | None)
Constructor for QgsValidityCheckResultsWidget, with the specified
parentwidget.- Parameters:
parent (Optional[QWidget])
- static runChecks(type: int, context: QgsValidityCheckContext | None, title: str | None, description: str | None, parent: QWidget | None = None) bool[source]¶
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
contextargument must specify the correctQgsValidityCheckContextsubclass for the given checktype.The
titleargument is used as the dialog’s title, and thedescriptiontext will be shown to users as an explanation of why the checks are being run.The
parentargument 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
Trueif 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.
- Parameters:
type (int)
context (Optional[QgsValidityCheckContext])
title (Optional[str])
description (Optional[str])
parent (Optional[QWidget] = None)
- Return type:
bool
- setDescription(self, description: str | None)[source]¶
Sets a
descriptionlabel to show at the top of the widget, e.g. notifying users of why they are being shown the warnings.- Parameters:
description (Optional[str])
- setResults(self, results: Iterable[QgsValidityCheckResult])[source]¶
Sets the list of check
resultsto show in the dialog.- Parameters:
results (Iterable[QgsValidityCheckResult])