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
29class Q_TESTLIB_EXPORT QAbstractItemModelTester : public QObject
30{
31 Q_OBJECT
32 Q_DECLARE_PRIVATE(QAbstractItemModelTester)
33
34public:
35 enum class FailureReportingMode {
36 QtTest,
37 Warning,
38 Fatal
39 };
40
41 QAbstractItemModelTester(QAbstractItemModel *model, QObject *parent = nullptr);
42 QAbstractItemModelTester(QAbstractItemModel *model, FailureReportingMode mode, QObject *parent = nullptr);
43
44 QAbstractItemModel *model() const;
45 FailureReportingMode failureReportingMode() const;
46 void setUseFetchMore(bool value);
47
48private:
49 bool verify(bool statement, const char *statementStr, const char *description, const char *file, int line);
50};
51
52QT_END_NAMESPACE
53
54#endif // QABSTRACTITEMMODELTESTER_H
The QAbstractItemModelTester class helps testing QAbstractItemModel subclasses.
Combined button and popup list for selecting options.
#define MODELTESTER_COMPARE(actual, expected)
#define MODELTESTER_VERIFY(statement)
QT_REQUIRE_CONFIG(itemmodeltester)