Type column of column table is coloured by type again. Close #49
The custom tableview in pgLab installs a custom delegate that tends to do what we need automatically and is more efficient. However it doesn't support custom colouring so we need to use the standard QStyledDelegate for the type column to get that working.
This commit is contained in:
parent
894e740401
commit
f6f275001e
1 changed files with 2 additions and 0 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "UserConfiguration.h"
|
||||
#include "catalog/PgClass.h"
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QStringBuilder>
|
||||
#include <unordered_set>
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ ColumnPage::ColumnPage(QWidget *parent)
|
|||
m_columnModel = new ColumnTableModel(this);
|
||||
m_sortFilterProxy = new QSortFilterProxyModel(this);
|
||||
m_sortFilterProxy->setSourceModel(m_columnModel);
|
||||
m_tableView->setItemDelegateForColumn(ColumnTableModel::TypeCol, new QStyledItemDelegate(this));
|
||||
m_tableView->setModel(m_sortFilterProxy);
|
||||
m_tableView->setSortingEnabled(true);
|
||||
m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue