QGIS API Documentation
3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
src
gui
qgsvaliditycheckresultswidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvaliditycheckresultswidget.cpp
3
----------------------------------
4
begin : November 2018
5
copyright : (C) 2018 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSVALIDITYCHECKRESULTSWIDGET_H
17
#define QGSVALIDITYCHECKRESULTSWIDGET_H
18
19
#include "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "ui_qgsvaliditycheckresultsbase.h"
22
23
#include "
qgsabstractvaliditycheck.h
"
24
25
#include <QWidget>
26
#include <QAbstractItemModel>
27
28
class
QgsValidityCheckContext
;
29
37
class
GUI_EXPORT
QgsValidityCheckResultsModel
:
public
QAbstractItemModel
38
{
39
Q_OBJECT
40
public
:
41
43
enum
Roles
44
{
45
DescriptionRole = Qt::UserRole + 1,
46
};
47
51
QgsValidityCheckResultsModel
(
const
QList< QgsValidityCheckResult > &results, QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
52
53
QModelIndex index(
int
row,
int
column,
const
QModelIndex &parent )
const override
;
54
QModelIndex parent(
const
QModelIndex &child )
const override
;
55
int
rowCount(
const
QModelIndex &parent = QModelIndex() )
const override
;
56
int
columnCount(
const
QModelIndex &parent )
const override
;
57
QVariant data(
const
QModelIndex &index,
int
role )
const override
;
58
private
:
59
60
QList< QgsValidityCheckResult > mResults;
61
};
62
70
class
GUI_EXPORT
QgsValidityCheckResultsWidget
:
public
QWidget,
private
Ui::QgsValidityCheckResultsBase
71
{
72
Q_OBJECT
73
74
public
:
75
79
QgsValidityCheckResultsWidget
( QWidget *parent
SIP_TRANSFERTHIS
);
80
85
void
setDescription(
const
QString &description );
86
90
void
setResults(
const
QList< QgsValidityCheckResult > &results );
91
112
static
bool
runChecks(
int
type,
const
QgsValidityCheckContext
*context,
const
QString &title,
const
QString &description, QWidget *parent =
nullptr
);
113
114
private
slots:
115
116
void
selectionChanged(
const
QModelIndex ¤t,
const
QModelIndex &previous );
117
118
private
:
119
120
QgsValidityCheckResultsModel
*mResultsModel =
nullptr
;
121
122
};
123
124
#endif
// QGSVALIDITYCHECKRESULTSWIDGET_H
QgsValidityCheckContext
Base class for validity check contexts.
Definition
qgsvaliditycheckcontext.h:36
QgsValidityCheckResultsModel
A QAbstractItemModel subclass for displaying the results from a QgsAbtractValidityCheck.
Definition
qgsvaliditycheckresultswidget.h:38
QgsValidityCheckResultsModel::Roles
Roles
Model roles.
Definition
qgsvaliditycheckresultswidget.h:44
QgsValidityCheckResultsWidget
A reusable widget which displays a summary of the results from a QgsAbstractValidityCheck (or checks)...
Definition
qgsvaliditycheckresultswidget.h:71
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:53
qgsabstractvaliditycheck.h
Generated on Mon Oct 30 2023 18:42:25 for QGIS API Documentation by
1.9.8