diff options
Diffstat (limited to 'src/modelutils.cpp')
| -rw-r--r-- | src/modelutils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modelutils.cpp b/src/modelutils.cpp index 43aa6b99..d464bb91 100644 --- a/src/modelutils.cpp +++ b/src/modelutils.cpp @@ -2,6 +2,17 @@ #include <QAbstractProxyModel> +QModelIndexList flatIndex( + const QAbstractItemModel* model, int column, const QModelIndex& parent) +{ + QModelIndexList index; + for (std::size_t i = 0; i < model->rowCount(parent); ++i) { + index.append(model->index(i, column, parent)); + index.append(flatIndex(model, column, index.back())); + } + return index; +} + QModelIndex indexModelToView(const QModelIndex& index, const QAbstractItemView* view) { // we need to stack the proxy |
