From f6f275001ed14987b9aaeb29f363ef28d9410215 Mon Sep 17 00:00:00 2001 From: eelke Date: Sun, 7 Jul 2019 14:37:42 +0200 Subject: [PATCH] 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. --- pglab/ColumnPage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pglab/ColumnPage.cpp b/pglab/ColumnPage.cpp index 892322d..18fef08 100644 --- a/pglab/ColumnPage.cpp +++ b/pglab/ColumnPage.cpp @@ -11,6 +11,7 @@ #include "UserConfiguration.h" #include "catalog/PgClass.h" #include +#include #include #include @@ -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);