How to set Qt::Vertical headerData of QSqlQueryModel increasing numbers when doing pagination
General and Desktop
4
Posts
3
Posters
2.5k
Views
1
Watching
-
im doing simple pagination with QSqlQueryModel select from limit query's
every thing is working fine . but. now i like to reflect the Vertical headerData of the QTableView .
im implementing the headerData , beacose it is const function i can't do any calculation inside it . so i have problem to calculate the right numbers in the Vertical headers. for example is im getting the rows from 20 to 30 .
i like the Vertical header show the numbers 20 to 30 . and so on ...
this is how i implement the headerData@QVariant PlayListSqlModel::headerData(int section, Qt::Orientation orientation, int role) const
{if(orientation == Qt::Vertical && role == Qt::DisplayRole) { return section; } if (role == Qt::DisplayRole) { if (orientation == Qt::Horizontal) { switch (section) { case 0: return QString("name"); case 1: return QString("From"); case 2: return QString("Created Time"); case 3: return QString("last name"); case 4: } } } return QVariant();
}@