2018-10-20 10:58:42 +02:00
|
|
|
|
#include "PropertiesPage.h"
|
2022-04-09 07:10:29 +02:00
|
|
|
|
#include "util/PgLabItemDelegate.h"
|
2018-10-20 10:58:42 +02:00
|
|
|
|
#include "PropertyProxyModel.h"
|
|
|
|
|
|
#include "ResultTableModelUtil.h"
|
2022-04-10 14:26:31 +02:00
|
|
|
|
#include "widgets/SqlCodePreview.h"
|
2022-04-09 07:10:29 +02:00
|
|
|
|
#include "util/PgLabTableView.h"
|
2019-02-09 14:59:33 +01:00
|
|
|
|
|
2018-10-20 10:58:42 +02:00
|
|
|
|
|
|
|
|
|
|
PropertiesPage::PropertiesPage(QWidget *parent) : QSplitter(parent)
|
|
|
|
|
|
{
|
2019-02-09 14:59:33 +01:00
|
|
|
|
m_tableView = new PgLabTableView(this);
|
2018-10-20 10:58:42 +02:00
|
|
|
|
addWidget(m_tableView);
|
|
|
|
|
|
|
|
|
|
|
|
SetTableViewDefault(m_tableView);
|
|
|
|
|
|
|
|
|
|
|
|
m_propertyProxyModel = new PropertyProxyModel(this);
|
|
|
|
|
|
m_tableView->setModel(m_propertyProxyModel);
|
|
|
|
|
|
|
|
|
|
|
|
auto item_delegate = new PgLabItemDelegate(this);
|
|
|
|
|
|
m_tableView->setItemDelegate(item_delegate);
|
2018-10-21 13:47:38 +02:00
|
|
|
|
m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
2018-10-20 10:58:42 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-21 13:47:38 +02:00
|
|
|
|
void PropertiesPage::setSourceModel(QAbstractItemModel *model)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_propertyProxyModel->setSourceModel(model);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PropertiesPage::setActiveRow(const QModelIndex &row)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_propertyProxyModel->setActiveRow(row);
|
2019-02-09 14:59:33 +01:00
|
|
|
|
m_tableView->resizeColumnsToContents();
|
2018-10-21 13:47:38 +02:00
|
|
|
|
}
|