{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
- void qabstractproxymodel_data();
void qabstractproxymodel();
void data_data();
void data();
void mapSelectionToSource();
void mapToSource_data();
void mapToSource();
- void revert_data();
void revert();
- void setSourceModel_data();
void setSourceModel();
void submit_data();
void submit();
}
};
-// This will be called before the first test function is executed.
-// It is only called once.
-void tst_QAbstractProxyModel::initTestCase()
-{
-}
-
-// This will be called after the last test function is executed.
-// It is only called once.
-void tst_QAbstractProxyModel::cleanupTestCase()
-{
-}
-
-// This will be called before each test function is executed.
-void tst_QAbstractProxyModel::init()
-{
-}
-
-// This will be called after every test function.
-void tst_QAbstractProxyModel::cleanup()
-{
-}
-
-void tst_QAbstractProxyModel::qabstractproxymodel_data()
-{
-}
-
void tst_QAbstractProxyModel::qabstractproxymodel()
{
SubQAbstractProxyModel model;
QCOMPARE(model.mapToSource(proxyIndex), mapToSource);
}
-void tst_QAbstractProxyModel::revert_data()
-{
- //QTest::addColumn<int>("foo");
- //QTest::newRow("null") << 0;
-}
-
// public void revert()
void tst_QAbstractProxyModel::revert()
{
- //QFETCH(int, foo);
-
SubQAbstractProxyModel model;
model.revert();
}
-void tst_QAbstractProxyModel::setSourceModel_data()
-{
- //QTest::addColumn<int>("sourceModelCount");
- //QTest::newRow("null") << 0;
-}
-
// public void setSourceModel(QAbstractItemModel* sourceModel)
void tst_QAbstractProxyModel::setSourceModel()
{
- //QFETCH(int, sourceModelCount);
-
SubQAbstractProxyModel model;
QStandardItemModel *sourceModel = new QStandardItemModel(&model);
model.setSourceModel(sourceModel);
Q_OBJECT
public:
-
tst_QIdentityProxyModel();
- virtual ~tst_QIdentityProxyModel();
public slots:
void initTestCase();
void cleanupTestCase();
- void init();
void cleanup();
private slots:
}
-tst_QIdentityProxyModel::~tst_QIdentityProxyModel()
-{
-
-}
-
void tst_QIdentityProxyModel::initTestCase()
{
qRegisterMetaType<QModelIndex>("QModelIndex");
delete m_model;
}
-void tst_QIdentityProxyModel::init()
-{
-}
-
void tst_QIdentityProxyModel::cleanup()
{
m_model->clear();
public:
tst_QItemSelectionModel();
- virtual ~tst_QItemSelectionModel();
-
public slots:
void initTestCase();
{
}
-tst_QItemSelectionModel::~tst_QItemSelectionModel()
-{
-}
-
/*
This test usually uses a model with a 5x5 table
-------------------------------------------
public:
tst_QSortFilterProxyModel();
- virtual ~tst_QSortFilterProxyModel();
public slots:
void initTestCase();
void cleanupTestCase();
- void init();
void cleanup();
private slots:
void insertRows_data();
void insertRows();
void prependRow();
-// void insertColumns_data();
-// void insertColumns();
void removeRows_data();
void removeRows();
void removeColumns_data();
}
-tst_QSortFilterProxyModel::~tst_QSortFilterProxyModel()
-{
-
-}
-
void tst_QSortFilterProxyModel::initTestCase()
{
qRegisterMetaType<QModelIndex>("QModelIndex");
delete m_model;
}
-void tst_QSortFilterProxyModel::init()
-{
-}
-
void tst_QSortFilterProxyModel::cleanup()
{
m_proxy->setFilterRegExp(QRegExp());
QCOMPARE(proxy.rowCount(QModelIndex()), 1); //only the "root" item is there
}
-
-/*
-void tst_QSortFilterProxyModel::insertColumns_data()
-{
-
-}
-
-void tst_QSortFilterProxyModel::insertColumns()
-{
-
-}
-*/
-
void tst_QSortFilterProxyModel::removeRows_data()
{
QTest::addColumn<QStringList>("initial");
{
Q_OBJECT
-public:
-
- tst_QStringListModel();
- virtual ~tst_QStringListModel();
-
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
private slots:
-
void rowsAboutToBeRemoved_rowsRemoved();
void rowsAboutToBeRemoved_rowsRemoved_data();
void rowsAboutToBeInserted_rowsInserted_data();
};
-
-tst_QStringListModel::tst_QStringListModel()
-
-{
-}
-
-tst_QStringListModel::~tst_QStringListModel()
-{
-}
-
-void tst_QStringListModel::initTestCase()
-{
-}
-
-void tst_QStringListModel::cleanupTestCase()
-{
-}
-
-void tst_QStringListModel::init()
-{
-}
-
-void tst_QStringListModel::cleanup()
-{
-}
-
-/*
- tests
-*/
-
-
void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
{
QTest::addColumn<QStringList>("input");