Improvements to the CrudModel

The new data of modified rows is now stored directly within the row_mapping
also changed how new rows are handled so the new empty row for inserting
is not a special case but is part of the list.
This commit is contained in:
eelke 2022-01-22 16:22:29 +01:00
parent a7f247bdee
commit 06504ecc1f
9 changed files with 213 additions and 317 deletions

View file

@ -1,45 +0,0 @@
#ifndef CRUDTAB_H
#define CRUDTAB_H
#include <QSortFilterProxyModel>
#include "catalog/PgClass.h"
#include "IDatabaseWindow.h"
#include <QWidget>
#include <memory>
#include <optional>
namespace Ui {
class CrudTab;
}
class OpenDatabase;
class CrudModel;
class CrudTab : public QWidget {
Q_OBJECT
public:
explicit CrudTab(IDatabaseWindow *context, QWidget *parent = nullptr);
~CrudTab() override;
void setConfig(Oid oid);
public slots:
void refresh();
private:
Ui::CrudTab *ui;
IDatabaseWindow *m_context;
std::shared_ptr<OpenDatabase> m_db;
std::optional<PgClass> m_table;
CrudModel *m_crudModel = nullptr;
QSortFilterProxyModel *m_SortFilterProxy = nullptr;
void initActions();
private slots:
void on_actionRemove_rows_triggered();
void headerCustomContextMenu(const QPoint &pos);
};
#endif // CRUDTAB_H