pgLab/pglab/FunctionsPage.cpp
eelke 840af1e0a9 WIP: Added page showing list of functions.
Only list is shown, still working on details.
2018-11-25 09:06:01 +01:00

40 lines
1 KiB
C++

#include "FunctionsPage.h"
#include "ResultTableModelUtil.h"
#include "CustomFilterSortModel.h"
#include "CustomDataRole.h"
#include "PgLabItemDelegate.h"
#include "ProcTableModel.h"
#include <QTableView>
#include <QVBoxLayout>
FunctionsPage::FunctionsPage(QWidget *parent) : QWidget(parent)
{
m_functionTable = new QTableView(this);
SetTableViewDefault(m_functionTable);
m_model = new ProcTableModel(this);
m_sortFilterProxy = new CustomFilterSortModel(this);
m_sortFilterProxy->setSourceModel(m_model);
m_functionTable->setModel(m_sortFilterProxy);
m_functionTable->setSortingEnabled(true);
m_functionTable->setSelectionBehavior(QAbstractItemView::SelectRows);
auto item_delegate = new PgLabItemDelegate(this);
m_functionTable->setItemDelegate(item_delegate);
auto mainLayout = new QVBoxLayout;
mainLayout->addWidget(m_functionTable);
setLayout(mainLayout);
}
void FunctionsPage::retranslateUi(bool all)
{
}
void FunctionsPage::setCatalog(std::shared_ptr<const PgDatabaseCatalog> cat)
{
m_catalog = cat;
m_model->setCatalog(cat);
}