pgLab/pglab/CrudTab.h
eelke 69473d65d2 Renamed MainWindow to DatabaseWindow so the name tells us the functionality provided by the window.
MainWindow was really a bad name as the app doesn't have a main window.
2018-12-28 12:55:11 +01:00

48 lines
935 B
C++

#ifndef CRUDTAB_H
#define CRUDTAB_H
#include "catalog/PgClass.h"
#include <QWidget>
#include "PlgPage.h"
#include <memory>
#include <optional>
namespace Ui {
class CrudTab;
}
class OpenDatabase;
class CrudModel;
class DatabaseWindow;
class CrudTab : public PlgPage
{
Q_OBJECT
public:
explicit CrudTab(DatabaseWindow *parent = 0);
~CrudTab() override;
void setConfig(std::shared_ptr<OpenDatabase> db, const PgClass &table);
void refresh();
virtual std::vector<QAction*> getToolbarActions() override;
private:
Ui::CrudTab *ui;
DatabaseWindow *m_window;
std::shared_ptr<OpenDatabase> m_db;
std::optional<PgClass> m_table;
CrudModel *m_crudModel = nullptr;
std::vector<QAction*> actions;
private slots:
// void tableView_currentRowChanged(const QModelIndex &current, const QModelIndex &previous);
void on_actionRemove_rows_triggered();
void headerCustomContextMenu(const QPoint &pos);
};
#endif // CRUDTAB_H