1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 |
3 | |
4 | #ifndef ERRORSVIEW_H |
5 | #define ERRORSVIEW_H |
6 | |
7 | #include <QListView> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | class QStandardItemModel; |
12 | |
13 | class MultiDataModel; |
14 | |
15 | class ErrorsView : public QListView |
16 | { |
17 | Q_OBJECT |
18 | public: |
19 | enum ErrorType { |
20 | SuperfluousAccelerator, |
21 | MissingAccelerator, |
22 | SurroundingWhitespaceDiffers, |
23 | PunctuationDiffers, |
24 | IgnoredPhrasebook, |
25 | PlaceMarkersDiffer, |
26 | NumerusMarkerMissing |
27 | }; |
28 | |
29 | ErrorsView(MultiDataModel *dataModel, QWidget *parent = 0); |
30 | void clear(); |
31 | void addError(int model, const ErrorType type, const QString &arg = QString()); |
32 | QString firstError(); |
33 | private: |
34 | void addError(int model, const QString &error); |
35 | QStandardItemModel *m_list; |
36 | MultiDataModel *m_dataModel; |
37 | }; |
38 | |
39 | QT_END_NAMESPACE |
40 | |
41 | #endif // ERRORSVIEW_H |
42 | |