Files
GenericQtClientCore/model/commands/removerowscommand.h

31 lines
756 B
C++

#ifndef REMOVEROWSCOMMAND_H
#define REMOVEROWSCOMMAND_H
#include <QUndoCommand>
class TableModel;
typedef QHash<int, QVariant> ModelItemValues;
class RemoveRowsCommand : public QUndoCommand {
public:
// TODO don't use simple pointer to model
/// Using simple pointer to model because there was a crash when closing the application with an
/// unclean undo stack
RemoveRowsCommand(TableModel* model,
const int startRow,
const int nRows,
QUndoCommand* parent = nullptr);
/// QUndoCommand interface
void undo() override;
void redo() override;
private:
TableModel* m_tableModel;
const int m_startRow;
QList<ModelItemValues> m_valueList;
};
#endif // REMOVEROWSCOMMAND_H