summaryrefslogtreecommitdiff
path: root/src/modelutils.h
blob: b5becb6cbc6fe81d33c11417ccf4e14ca6a80b89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef MODELUTILS_H
#define MODELUTILS_H

#include <QAbstractItemView>
#include <QAbstractItemModel>

// retrieve all the row index under the given parent
QModelIndexList flatIndex(
  const QAbstractItemModel* model, int column = 0, const QModelIndex& parent = QModelIndex());

// convert back-and-forth through model proxies
QModelIndex indexModelToView(const QModelIndex& index, const QAbstractItemView* view);
QModelIndexList indexModelToView(const QModelIndexList& index, const QAbstractItemView* view);
QModelIndex indexViewToModel(const QModelIndex& index, const QAbstractItemModel* model);
QModelIndexList indexViewToModel(const QModelIndexList& index, const QAbstractItemModel* model);


#endif