- Moved detail tabs of table to their own components - Table list has become seperate component on seperate tab - Table list does not use designer anymore - Moved sequences and functions tabs into the catalog inspector
35 lines
989 B
C++
35 lines
989 B
C++
#include "CatalogPageBase.h"
|
|
#include "CustomFilterSortModel.h"
|
|
#include "PgLabTableView.h"
|
|
#include "SqlCodePreview.h"
|
|
|
|
CatalogPageBase::CatalogPageBase(QWidget *parent)
|
|
: QSplitter(Qt::Vertical, parent)
|
|
{
|
|
m_tableView = new PgLabTableView(this);
|
|
m_definitionView = new SqlCodePreview(this);
|
|
addWidget(m_tableView);
|
|
addWidget(m_definitionView);
|
|
|
|
m_sortFilterProxy = new CustomFilterSortModel(this);
|
|
|
|
m_tableView->setModel(m_sortFilterProxy);
|
|
m_tableView->setSortingEnabled(true);
|
|
m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
}
|
|
|
|
void CatalogPageBase::setCatalog(std::shared_ptr<const PgDatabaseCatalog> cat)
|
|
{
|
|
m_catalog = cat;
|
|
m_definitionView->setCatalog(m_catalog);
|
|
catalogSet();
|
|
}
|
|
|
|
std::unordered_set<int> CatalogPageBase::selectedRows() const
|
|
{
|
|
auto&& indexes = m_tableView->selectionModel()->selectedIndexes();
|
|
std::unordered_set<int> rijen;
|
|
for (const auto &e : indexes)
|
|
rijen.insert(m_sortFilterProxy->mapToSource(e).row());
|
|
return rijen;
|
|
}
|