Double clicking a table now opens a CRUD page for that table however data cannot be changed yet thought it will display an editbox.

This commit is contained in:
eelke 2018-01-09 20:39:43 +01:00
parent abd4020ddf
commit 2ba27178a2
13 changed files with 288 additions and 33 deletions

View file

@ -1,14 +1,38 @@
#include "CrudTab.h"
#include "CrudTab.h"
#include "ui_CrudTab.h"
#include "CrudModel.h"
#include "MainWindow.h"
#include "ResultTableModelUtil.h"
CrudTab::CrudTab(QWidget *parent) :
QWidget(parent),
ui(new Ui::CrudTab)
CrudTab::CrudTab(MainWindow *parent)
: QWidget(parent)
, ui(new Ui::CrudTab)
, m_window(parent)
{
ui->setupUi(this);
SetTableViewDefault(ui->tableView);
m_crudModel = new CrudModel(parent);
ui->tableView->setModel(m_crudModel);
}
CrudTab::~CrudTab()
{
delete ui;
}
void CrudTab::setConfig(std::shared_ptr<OpenDatabase> db, const PgClass &table)
{
m_db = db;
m_table = table;
// m_catalog = cat;
// m_tablesModel->setCatalog(cat);
// ui->tableListTable->resizeColumnsToContents();
// m_namespaceFilterWidget->init(cat->namespaces());
// auto highlighter = new SqlSyntaxHighlighter(ui->constraintSqlEdit->document());
// highlighter->setTypes(*cat->types());
m_crudModel->setConfig(db, table);
}