PgAttribute loading + ColummnTableModel
Required enchancement to PgContainer to make multifield key work.
This commit is contained in:
parent
f9caadb59e
commit
e9d72d391d
32 changed files with 698 additions and 99 deletions
|
|
@ -1,7 +1,10 @@
|
|||
#include "TablesPage.h"
|
||||
#include "ui_TablesPage.h"
|
||||
|
||||
#include "PgAttribute.h"
|
||||
#include "TablesTableModel.h"
|
||||
#include "ResultTableModelUtil.h"
|
||||
#include "ColumnTableModel.h"
|
||||
|
||||
TablesPage::TablesPage(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
|
|
@ -9,9 +12,22 @@ TablesPage::TablesPage(QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
SetTableViewDefault(ui->tableListTable);
|
||||
m_tablesModel = new TablesTableModel(this);
|
||||
ui->tableListTable->setModel(m_tablesModel);
|
||||
|
||||
SetTableViewDefault(ui->columnsTable);
|
||||
m_columnsModel = new ColumnTableModel(this);
|
||||
ui->columnsTable->setModel(m_columnsModel);
|
||||
|
||||
connect(ui->tableListTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this,
|
||||
&TablesPage::on_tableListTable_currentRowChanged);
|
||||
|
||||
}
|
||||
|
||||
TablesPage::~TablesPage()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TablesPage::setCatalog(std::shared_ptr<PgDatabaseCatalog> cat)
|
||||
|
|
@ -20,7 +36,10 @@ void TablesPage::setCatalog(std::shared_ptr<PgDatabaseCatalog> cat)
|
|||
m_tablesModel->setCatalog(cat);
|
||||
}
|
||||
|
||||
TablesPage::~TablesPage()
|
||||
void TablesPage::on_tableListTable_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
{
|
||||
delete ui;
|
||||
if (current.row() != previous.row()) {
|
||||
Oid table_oid = m_tablesModel->getTableOid(current.row());
|
||||
m_columnsModel->setData(m_catalog, table_oid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue