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:
eelke 2019-07-07 14:37:42 +02:00
parent 894e740401
commit f6f275001e

View file

@ -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);