Restructuring catalog tabs
- 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
This commit is contained in:
parent
a704332342
commit
42432b06a9
31 changed files with 598 additions and 472 deletions
35
pglab/widgets/CatalogPageBase.cpp
Normal file
35
pglab/widgets/CatalogPageBase.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue