diff options
Diffstat (limited to 'tests/auto/qabstractitemmodel/dynamictreemodel.h')
-rw-r--r-- | tests/auto/qabstractitemmodel/dynamictreemodel.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qabstractitemmodel/dynamictreemodel.h b/tests/auto/qabstractitemmodel/dynamictreemodel.h index 88e293c..c19ed9d 100644 --- a/tests/auto/qabstractitemmodel/dynamictreemodel.h +++ b/tests/auto/qabstractitemmodel/dynamictreemodel.h @@ -70,6 +70,8 @@ private: friend class ModelInsertCommand; friend class ModelMoveCommand; + friend class ModelResetCommand; + friend class ModelResetCommandFixed; }; @@ -118,6 +120,7 @@ public: virtual void doCommand(); }; + class ModelMoveCommand : public ModelChangeCommand { Q_OBJECT @@ -126,8 +129,12 @@ public: virtual ~ModelMoveCommand() {} + virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); + virtual void doCommand(); + virtual void emitPostSignal(); + void setDestAncestors( QList<int> rows ) { m_destRowNumbers = rows; } void setDestRow(int row) { m_destRow = row; } @@ -137,5 +144,37 @@ protected: int m_destRow; }; +/** + A command which does a move and emits a reset signal. +*/ +class ModelResetCommand : public ModelMoveCommand +{ + Q_OBJECT +public: + ModelResetCommand(DynamicTreeModel* model, QObject* parent = 0); + + virtual ~ModelResetCommand(); + + virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); + virtual void emitPostSignal(); + +}; + +/** + A command which does a move and emits a beginResetModel and endResetModel signals. +*/ +class ModelResetCommandFixed : public ModelMoveCommand +{ + Q_OBJECT +public: + ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent = 0); + + virtual ~ModelResetCommandFixed(); + + virtual bool emitPreSignal(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destRow); + virtual void emitPostSignal(); + +}; + #endif |