Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qabstractitemmodeltester.h
Go to the documentation of this file.
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
22
23QT_BEGIN_NAMESPACE
24
25class QAbstractItemModel;
26class QAbstractItemModelTester;
27class QAbstractItemModelTesterPrivate;
28
29namespace QTestPrivate {
30inline bool testDataGuiRoles(QAbstractItemModelTester *tester);
31}
32
33class Q_TESTLIB_EXPORT QAbstractItemModelTester : public QObject
34{
35 Q_OBJECT
36 Q_DECLARE_PRIVATE(QAbstractItemModelTester)
37
38public:
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
52private:
53 bool verify(bool statement, const char *statementStr, const char *description, const char *file, int line);
54};
55
56QT_END_NAMESPACE
57
58#endif // QABSTRACTITEMMODELTESTER_H
The QAbstractItemModelTester class helps testing QAbstractItemModel subclasses.
Combined button and popup list for selecting options.
bool testDataGuiRoles(QAbstractItemModelTester *tester)
#define MODELTESTER_COMPARE(actual, expected)
#define MODELTESTER_VERIFY(statement)
QT_REQUIRE_CONFIG(itemmodeltester)