1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QABSTRACTITEMMODELTESTER_H |
5 | #define QABSTRACTITEMMODELTESTER_H |
6 | |
7 | #include <QtCore/QObject> |
8 | #include <QtTest/qttestglobal.h> |
9 | #include <QtCore/QAbstractItemModel> |
10 | #include <QtCore/QVariant> |
11 | |
12 | #ifdef QT_GUI_LIB |
13 | #include <QtGui/QFont> |
14 | #include <QtGui/QColor> |
15 | #include <QtGui/QBrush> |
16 | #include <QtGui/QPixmap> |
17 | #include <QtGui/QImage> |
18 | #include <QtGui/QIcon> |
19 | #endif |
20 | |
21 | QT_REQUIRE_CONFIG(itemmodeltester); |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QAbstractItemModel; |
26 | class QAbstractItemModelTester; |
27 | class QAbstractItemModelTesterPrivate; |
28 | |
29 | namespace QTestPrivate { |
30 | inline bool testDataGuiRoles(QAbstractItemModelTester *tester); |
31 | } |
32 | |
33 | class Q_TESTLIB_EXPORT QAbstractItemModelTester : public QObject |
34 | { |
35 | Q_OBJECT |
36 | Q_DECLARE_PRIVATE(QAbstractItemModelTester) |
37 | |
38 | public: |
39 | enum class FailureReportingMode { |
40 | QtTest, |
41 | Warning, |
42 | Fatal |
43 | }; |
44 | |
45 | QAbstractItemModelTester(QAbstractItemModel *model, QObject *parent = nullptr); |
46 | QAbstractItemModelTester(QAbstractItemModel *model, FailureReportingMode mode, QObject *parent = nullptr); |
47 | |
48 | QAbstractItemModel *model() const; |
49 | FailureReportingMode failureReportingMode() const; |
50 | void setUseFetchMore(bool value); |
51 | |
52 | private: |
53 | bool verify(bool statement, const char *statementStr, const char *description, const char *file, int line); |
54 | }; |
55 | |
56 | QT_END_NAMESPACE |
57 | |
58 | #endif // QABSTRACTITEMMODELTESTER_H |
59 |