Added column number to list of columns of table.

This commit is contained in:
eelke 2018-08-05 09:05:56 +02:00
parent 31afc6fcbf
commit f5e9c4b74e
2 changed files with 7 additions and 0 deletions

View file

@ -58,6 +58,9 @@ QVariant ColumnTableModel::headerData(int section, Qt::Orientation orientation,
} }
else { else {
switch (section) { switch (section) {
case AttnumCol:
c = tr("#");
break;
case NameCol: case NameCol:
c = tr("Name"); c = tr("Name");
break; break;
@ -174,6 +177,9 @@ QVariant ColumnTableModel::getData(const QModelIndex &index) const
else { else {
QString s; QString s;
switch (col) { switch (col) {
case AttnumCol:
s = QString::asprintf("%d", (int) t.num);
break;
case NameCol: case NameCol:
s = t.name; s = t.name;
break; break;

View file

@ -13,6 +13,7 @@ class PgAttribute;
class ColumnTableModel: public BaseTableModel { class ColumnTableModel: public BaseTableModel {
public: public:
enum e_Columns : int { enum e_Columns : int {
AttnumCol,
NameCol, /// NameCol, ///
TypeCol, TypeCol,
NullCol, NullCol,