Show name of index in hint of column header for the index of the column tableview.
This commit is contained in:
parent
23840ce7c5
commit
8a27a1166f
1 changed files with 8 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue