app: for root items, show index as well

This commit is contained in:
itsmattkc 2022-07-11 01:57:37 -07:00
parent cb53beb445
commit 01d5395c7c

View file

@ -26,7 +26,11 @@ QVariant ObjectModel::data(const QModelIndex &index, int role) const
switch (index.column()) { switch (index.column()) {
case kColIndex: case kColIndex:
if (Object *o = dynamic_cast<Object*>(c)) { if (Object *o = dynamic_cast<Object*>(c)) {
return QString::number(o->id()); if (!index.parent().isValid()) {
return tr("%1:%2").arg(QString::number(index.row()), QString::number(o->id()));
} else {
return QString::number(o->id());
}
} }
//return index.row(); //return index.row();
break; break;