mpdata/tsrc/unittest_mpmpxcollectiondata/inc/unittest_helper.h
changeset 55 f3930dda3342
equal deleted inserted replaced
51:560ce2306a17 55:f3930dda3342
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Unit test helper for mpcollectiondatamodel
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef TESTHELPER_H
       
    19 #define TESTHELPER_H
       
    20 
       
    21 #include <QAbstractListModel>
       
    22 
       
    23 class TestHelper : public QAbstractListModel
       
    24 {
       
    25     Q_OBJECT
       
    26 
       
    27 public:
       
    28 
       
    29     TestHelper(QObject *parent=0);
       
    30     virtual ~TestHelper();
       
    31 
       
    32     // These are dummy; We have to inherit from QAbstractListModel so that
       
    33     // we can invoke the protected member QAbstractItemModel::createIndex()
       
    34     int rowCount(const QModelIndex &parent=QModelIndex()) const;
       
    35     QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
       
    36 
       
    37     QModelIndex indexFor(int index);
       
    38 };
       
    39 
       
    40 #endif  // TESTHELPER_H
       
    41 
       
    42 
       
    43 
       
    44