Addded HorizontalProxyModel which is used to effictively rotate a table 90 degrees.

This commit is contained in:
eelke 2018-08-25 18:14:08 +02:00
parent 50cb21b6f9
commit 68a1a8e7c9
3 changed files with 78 additions and 2 deletions

View file

@ -0,0 +1,18 @@
#ifndef HORIZONTALPROXYMODEL_H
#define HORIZONTALPROXYMODEL_H
#include <QAbstractProxyModel>
class HorizontalProxyModel : public QAbstractProxyModel {
public:
HorizontalProxyModel(QObject * parent = nullptr);
QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex parent(const QModelIndex &child) const;
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
};
#endif // HORIZONTALPROXYMODEL_H