// public QMap<int,QVariant> itemData(QModelIndex const& index) const void tst_QAbstractProxyModel::itemData() { QFETCH(QModelIndex, index); QFETCH(int, count); SubQAbstractProxyModel model; QCOMPARE(model.itemData(index).count(), count); }
// public bool submit() void tst_QAbstractProxyModel::submit() { QFETCH(bool, submit); SubQAbstractProxyModel model; QCOMPARE(model.submit(), submit); }
// public void revert() void tst_QAbstractProxyModel::revert() { //QFETCH(int, foo); SubQAbstractProxyModel model; model.revert(); }
// public QModelIndex mapToSource(QModelIndex const& proxyIndex) const void tst_QAbstractProxyModel::mapToSource() { QFETCH(QModelIndex, proxyIndex); QFETCH(QModelIndex, mapToSource); SubQAbstractProxyModel model; QCOMPARE(model.mapToSource(proxyIndex), mapToSource); }
// public QItemSelection mapSelectionToSource(QItemSelection const& selection) const void tst_QAbstractProxyModel::mapSelectionToSource() { QFETCH(QItemSelection, selection); QFETCH(QItemSelection, mapSelectionToSource); SubQAbstractProxyModel model; QCOMPARE(model.mapSelectionToSource(selection), mapSelectionToSource); }
// public QModelIndex mapFromSource(QModelIndex const& sourceIndex) const void tst_QAbstractProxyModel::mapFromSource() { QFETCH(QModelIndex, sourceIndex); QFETCH(QModelIndex, mapFromSource); SubQAbstractProxyModel model; QCOMPARE(model.mapFromSource(sourceIndex), mapFromSource); }
// public Qt::ItemFlags flags(QModelIndex const& index) const void tst_QAbstractProxyModel::flags() { QFETCH(QModelIndex, index); QFETCH(Qt::ItemFlags, flags); SubQAbstractProxyModel model; QCOMPARE(model.flags(index), flags); }
// public QVariant data(QModelIndex const& proxyIndex, int role = Qt::DisplayRole) const void tst_QAbstractProxyModel::data() { QFETCH(QModelIndex, proxyIndex); QFETCH(int, role); QFETCH(QVariant, data); SubQAbstractProxyModel model; QCOMPARE(model.data(proxyIndex, role), data); }
// public QVariant headerData(int section, Qt::Orientation orientation, int role) const void tst_QAbstractProxyModel::headerData() { QFETCH(int, section); QFETCH(Qt::Orientation, orientation); QFETCH(Qt::ItemDataRole, role); QFETCH(QVariant, headerData); SubQAbstractProxyModel model; QCOMPARE(model.headerData(section, orientation, role), headerData); }
// public void setSourceModel(QAbstractItemModel* sourceModel) void tst_QAbstractProxyModel::setSourceModel() { //QFETCH(int, sourceModelCount); SubQAbstractProxyModel model; QStandardItemModel *sourceModel = new QStandardItemModel(&model); model.setSourceModel(sourceModel); QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(sourceModel)); QStandardItemModel *sourceModel2 = new QStandardItemModel(&model); model.setSourceModel(sourceModel2); QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(sourceModel2)); delete sourceModel2; QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(0)); }
void tst_QAbstractProxyModel::qabstractproxymodel() { SubQAbstractProxyModel model; model.data(QModelIndex()); model.flags(QModelIndex()); model.headerData(0, Qt::Vertical, 0); model.itemData(QModelIndex()); model.mapFromSource(QModelIndex()); model.mapSelectionFromSource(QItemSelection()); model.mapSelectionToSource(QItemSelection()); model.mapToSource(QModelIndex()); model.revert(); model.setSourceModel(0); QCOMPARE(model.sourceModel(), (QAbstractItemModel*)0); model.submit(); }
// public void setSourceModel(QAbstractItemModel* sourceModel) void tst_QAbstractProxyModel::setSourceModel() { qRegisterMetaType<QAbstractItemModel*>(); SubQAbstractProxyModel model; QCOMPARE(model.property("sourceModel"), QVariant::fromValue<QAbstractItemModel*>(0)); QStandardItemModel *sourceModel = new QStandardItemModel(&model); model.setSourceModel(sourceModel); QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(sourceModel)); QCOMPARE(model.property("sourceModel").value<QObject*>(), static_cast<QObject*>(sourceModel)); QCOMPARE(model.property("sourceModel").value<QAbstractItemModel*>(), sourceModel); QStandardItemModel *sourceModel2 = new QStandardItemModel(&model); model.setSourceModel(sourceModel2); QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(sourceModel2)); QCOMPARE(model.property("sourceModel").value<QObject*>(), static_cast<QObject*>(sourceModel2)); QCOMPARE(model.property("sourceModel").value<QAbstractItemModel*>(), sourceModel2); delete sourceModel2; QCOMPARE(model.sourceModel(), static_cast<QAbstractItemModel*>(0)); }
// public void revert() void tst_QAbstractProxyModel::revert() { SubQAbstractProxyModel model; model.revert(); }