cleanup QSortFilterProxyModel tests

Cleanup QSortFilterProxyModel tests:
 - adjust includes
 - use nullptr
 - use override
 - avoid unneeded casts
 - use new signal/slot syntax

Change-Id: I05f7c18cd2642bc8251bf1560803e7635684d24d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Christian Ehrlicher 2019-10-19 18:01:08 +02:00
parent 31cbda4833
commit 9ae0fa4d49
3 changed files with 249 additions and 311 deletions

View File

@ -29,19 +29,10 @@
#ifndef TST_QSORTFILTERPROXYMODEL_H
#define TST_QSORTFILTERPROXYMODEL_H
#include <QtTest/QtTest>
#include "dynamictreemodel.h"
#include <QtCore/QCoreApplication>
#include <QtGui/QStandardItem>
#include <QtWidgets/QTreeView>
#include <QtWidgets/QTableView>
#include <qdebug.h>
typedef QList<int> IntList;
typedef QPair<int, int> IntPair;
typedef QList<IntPair> IntPairList;
#include <QLoggingCategory>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
enum class FilterType {
RegExp,
@ -53,10 +44,6 @@ Q_DECLARE_METATYPE(QList<QPersistentModelIndex>)
class tst_QSortFilterProxyModel : public QObject
{
Q_OBJECT
public:
tst_QSortFilterProxyModel();
public slots:
void initTestCase();
void cleanupTestCase();
@ -181,8 +168,8 @@ protected:
FilterType m_filterType;
private:
QStandardItemModel *m_model;
QSortFilterProxyModel *m_proxy;
QStandardItemModel *m_model = nullptr;
QSortFilterProxyModel *m_proxy = nullptr;
};
Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)

View File

@ -28,9 +28,8 @@
#include <QTest>
#include <QSignalSpy>
#include <QtCore/QSortFilterProxyModel>
#include <QtGui/QStandardItem>
#include <QSortFilterProxyModel>
#include <QStandardItem>
Q_DECLARE_METATYPE(QModelIndex)