Use PgLabItemDelegate for indexes tab.
This commit is contained in:
parent
07c1b63d44
commit
e1405d5370
3 changed files with 22 additions and 9 deletions
|
|
@ -15,17 +15,17 @@ void IndexModel::setData(std::shared_ptr<const PgDatabaseCatalog> cat, const PgC
|
|||
m_indexes = cat->indexes()->getIndexesForTable(table.oid);
|
||||
}
|
||||
|
||||
int IndexModel::rowCount(const QModelIndex &parent) const
|
||||
int IndexModel::rowCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return m_indexes.size();
|
||||
}
|
||||
|
||||
int IndexModel::columnCount(const QModelIndex &parent) const
|
||||
int IndexModel::columnCount(const QModelIndex &/*parent*/) const
|
||||
{
|
||||
return colCount;
|
||||
}
|
||||
|
||||
Oid IndexModel::getType(int column) const
|
||||
Oid IndexModel::getType(int /*column*/) const
|
||||
{
|
||||
return Pgsql::varchar_oid;
|
||||
}
|
||||
|
|
@ -83,3 +83,13 @@ QVariant IndexModel::getData(const QModelIndex &index) const
|
|||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
QVariant IndexModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
QVariant v;
|
||||
if (role == Qt::DisplayRole)
|
||||
v = getData(index);
|
||||
else if (role == Qt::UserRole)
|
||||
v = getType(index.column());
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue