Introduct mapRowToSource and mapRowFromSource
REVIEW: 105044
This commit is contained in:
parent
0ddb12cf96
commit
bb8eef7db1
@ -131,7 +131,17 @@ QVariantHash SortFilterModel::get(int row) const
|
||||
return hash;
|
||||
}
|
||||
|
||||
int SortFilterModel::mapRowToSource(int row) const
|
||||
{
|
||||
QModelIndex idx = index(row, 0);
|
||||
return mapToSource(idx).row();
|
||||
}
|
||||
|
||||
int SortFilterModel::mapRowFromSource(int row) const
|
||||
{
|
||||
QModelIndex idx = index(row, 0);
|
||||
return mapFromSource(idx).row();
|
||||
}
|
||||
|
||||
DataModel::DataModel(QObject* parent)
|
||||
: QAbstractItemModel(parent),
|
||||
|
@ -99,6 +99,10 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE QVariantHash get(int i) const;
|
||||
|
||||
Q_INVOKABLE int mapRowToSource(int i) const;
|
||||
|
||||
Q_INVOKABLE int mapRowFromSource(int i) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void countChanged();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user