modeltest.h (krename-4.0.9) | : | modeltest.h (krename-4.90.90) | ||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
** sales department at sales@trolltech.com. | ** sales department at sales@trolltech.com. | |||
** | ** | |||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |||
** | ** | |||
****************************************************************************/ | ****************************************************************************/ | |||
#ifndef MODELTEST_H | #ifndef MODELTEST_H | |||
#define MODELTEST_H | #define MODELTEST_H | |||
#include <QtCore/QObject> | #include <QObject> | |||
#include <QtCore/QAbstractItemModel> | #include <QAbstractItemModel> | |||
#include <QtCore/QStack> | #include <QStack> | |||
class ModelTest : public QObject | class ModelTest : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
ModelTest(QAbstractItemModel *model, QObject *parent = 0); | explicit ModelTest(QAbstractItemModel *model, QObject *parent = 0); | |||
private Q_SLOTS: | private Q_SLOTS: | |||
void nonDestructiveBasicTest(); | void nonDestructiveBasicTest(); | |||
void rowCount(); | void rowCount(); | |||
void columnCount(); | void columnCount(); | |||
void hasIndex(); | void hasIndex(); | |||
void index(); | void index(); | |||
void parent(); | void parent(); | |||
void data(); | void data(); | |||
protected Q_SLOTS: | protected Q_SLOTS: | |||
void runAllTests(); | void runAllTests(); | |||
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end); | void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end); | |||
void rowsInserted(const QModelIndex & parent, int start, int end); | void rowsInserted(const QModelIndex &parent, int start, int end); | |||
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); | void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); | |||
void rowsRemoved(const QModelIndex & parent, int start, int end); | void rowsRemoved(const QModelIndex &parent, int start, int end); | |||
private: | private: | |||
void checkChildren(const QModelIndex &parent, int currentDepth = 0); | void checkChildren(const QModelIndex &parent, int currentDepth = 0); | |||
QAbstractItemModel *model; | QAbstractItemModel *model; | |||
struct Changing | struct Changing { | |||
{ | ||||
QModelIndex parent; | QModelIndex parent; | |||
int oldSize; | int oldSize; | |||
QVariant last; | QVariant last; | |||
QVariant next; | QVariant next; | |||
}; | }; | |||
QStack<Changing> insert; | QStack<Changing> insert; | |||
QStack<Changing> remove; | QStack<Changing> remove; | |||
bool fetchingMore; | bool fetchingMore; | |||
}; | }; | |||
End of changes. 5 change blocks. | ||||
8 lines changed or deleted | 7 lines changed or added |