SelectionEditorFactory + ItemModel + ItemModelFactory combination is working

in new EditTableWidget

(EditTableWidget is very much WIP)
This commit is contained in:
eelke 2018-12-15 20:27:40 +01:00
parent e44f73166f
commit 742fd0a4d3
19 changed files with 419 additions and 80 deletions

View file

@ -20,6 +20,7 @@
#include "CrudTab.h"
#include "WorkManager.h"
#include "ScopeGuard.h"
#include "EditTableWidget.h"
namespace pg = Pgsql;
@ -43,20 +44,22 @@ QueryTab* MainWindow::newSqlPage()
{
QueryTab *qt = new QueryTab(this);
qt->setConfig(m_config, m_database->catalog());
// ui->tabWidget->addTab(qt, "Tab");
// ui->tabWidget->setCurrentWidget(qt);
addPage(qt, "Tab");
qt->newdoc();
qt->focusEditor();
return qt;
}
void MainWindow::newCreateTablePage()
{
auto w = new EditTableWidget(m_database, this);
ui->tabWidget->addTab(w, "Create table");
}
void MainWindow::newCrudPage(const PgClass &table)
{
CrudTab *ct = new CrudTab(this);
ct->setConfig(m_database, table);
// ui->tabWidget->addTab(ct, table.name);
// ui->tabWidget->setCurrentWidget(ct);
addPage(ct, table.objectName());
}
@ -110,6 +113,7 @@ void MainWindow::catalogLoaded()
ui->tabWidget->addTab(functions_page, "Functions");
newSqlPage();
newCreateTablePage();
} catch (std::runtime_error &ex) {
QMessageBox::critical(this, "Error reading database",
QString::fromUtf8(ex.what()));