41 lines
1 KiB
C++
41 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);
|
|||
|
|
}
|