pgLab/pglab/crud/CrudTab.h
eelke 06504ecc1f 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.
2022-01-22 16:22:29 +01:00

45 lines
836 B
C++

#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