From 8a27a1166fad57a45e06c5c7d0aaa5f8f7efc0be Mon Sep 17 00:00:00 2001 From: eelke Date: Wed, 20 Dec 2017 20:05:54 +0100 Subject: [PATCH] Show name of index in hint of column header for the index of the column tableview. --- pglab/ColumnTableModel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pglab/ColumnTableModel.cpp b/pglab/ColumnTableModel.cpp index 92e8aa6..1257291 100644 --- a/pglab/ColumnTableModel.cpp +++ b/pglab/ColumnTableModel.cpp @@ -2,6 +2,7 @@ #include "PgDatabaseCatalog.h" #include "PgAttribute.h" #include "PgAttributeContainer.h" +#include "PgClassContainer.h" #include "PgType.h" #include "PgTypeContainer.h" #include "PgIndexContainer.h" @@ -78,12 +79,16 @@ QVariant ColumnTableModel::headerData(int section, Qt::Orientation orientation, else if (role == Qt::ToolTipRole) { if (section >= colCount) { const auto &tbl_idx = m_indexes[section - colCount]; + auto idx_cls = m_catalog->classes()->getByKey(tbl_idx.indexrelid); + QString s; if (tbl_idx.isprimary) - v = tr("Primary key"); + s = tr("Primary key"); else if (tbl_idx.isunique) - v = tr("Unique index"); + s = tr("Unique index"); else - v = tr("Index"); + s = tr("Index"); + s += "\n" + idx_cls.name; + v = s; } else { switch (section) {