此代理转置源模型。 更多...
头: | #include <QTransposeProxyModel> |
CMake: |
find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
Since: | Qt 5.13 |
继承: | QAbstractProxyModel |
QTransposeProxyModel (QObject * parent = nullptr) | |
virtual | ~QTransposeProxyModel () |
virtual int | columnCount (const QModelIndex & parent = QModelIndex()) const override |
virtual QVariant | headerData (int section , Qt::Orientation orientation , int role = Qt::DisplayRole) const override |
virtual QModelIndex | index (int row , int column , const QModelIndex & parent = QModelIndex()) const override |
virtual bool | insertColumns (int column , int count , const QModelIndex & parent = QModelIndex()) override |
virtual bool | insertRows (int row , int count , const QModelIndex & parent = QModelIndex()) override |
virtual QMap<int, QVariant> | itemData (const QModelIndex & index ) const override |
virtual QModelIndex | mapFromSource (const QModelIndex & sourceIndex ) const override |
virtual QModelIndex | mapToSource (const QModelIndex & proxyIndex ) const override |
virtual bool | moveColumns (const QModelIndex & sourceParent , int sourceRow , int count , const QModelIndex & destinationParent , int destinationChild ) override |
virtual bool | moveRows (const QModelIndex & sourceParent , int sourceRow , int count , const QModelIndex & destinationParent , int destinationChild ) override |
virtual QModelIndex | parent (const QModelIndex & index ) const override |
virtual bool | removeColumns (int column , int count , const QModelIndex & parent = QModelIndex()) override |
virtual bool | removeRows (int row , int count , const QModelIndex & parent = QModelIndex()) override |
virtual int | rowCount (const QModelIndex & parent = QModelIndex()) const override |
virtual bool | setHeaderData (int section , Qt::Orientation orientation , const QVariant & value , int role = Qt::EditRole) override |
virtual bool | setItemData (const QModelIndex & index , const QMap<int, QVariant> & roles ) override |
virtual void | setSourceModel (QAbstractItemModel * newSourceModel ) override |
virtual void | sort (int column , Qt::SortOrder order = Qt::AscendingOrder) override |
virtual QSize | span (const QModelIndex & index ) const override |
This model will make the rows of the source model become columns of the proxy model and vice-versa.
If the model is a tree, the parents will be transposed as well. For example, if an index in the source model had parent `index(2,0)`, it will have parent `index(0,2)` in the proxy.
Constructs a new proxy model with the given parent .
[virtual]
QTransposeProxyModel::
~QTransposeProxyModel
()
Destructs the proxy model.
[override virtual]
int
QTransposeProxyModel::
columnCount
(const
QModelIndex
&
parent
= QModelIndex()) const
重实现: QAbstractItemModel::columnCount (const QModelIndex &parent) const.
[override virtual]
QVariant
QTransposeProxyModel::
headerData
(
int
section
,
Qt::Orientation
orientation
,
int
role
= Qt::DisplayRole) const
重实现: QAbstractProxyModel::headerData (int section, Qt::Orientation orientation, int role) const.
另请参阅 setHeaderData ().
[override virtual]
QModelIndex
QTransposeProxyModel::
index
(
int
row
,
int
column
, const
QModelIndex
&
parent
= QModelIndex()) const
重实现: QAbstractItemModel::index (int row, int column, const QModelIndex &parent) const.
[override virtual]
bool
QTransposeProxyModel::
insertColumns
(
int
column
,
int
count
, const
QModelIndex
&
parent
= QModelIndex())
重实现: QAbstractItemModel::insertColumns (int column, int count, const QModelIndex &parent).
[override virtual]
bool
QTransposeProxyModel::
insertRows
(
int
row
,
int
count
, const
QModelIndex
&
parent
= QModelIndex())
重实现: QAbstractItemModel::insertRows (int row, int count, const QModelIndex &parent).
[override virtual]
QMap
<
int
,
QVariant
> QTransposeProxyModel::
itemData
(const
QModelIndex
&
index
) const
重实现: QAbstractProxyModel::itemData (const QModelIndex &proxyIndex) const.
另请参阅 setItemData ().
[override virtual]
QModelIndex
QTransposeProxyModel::
mapFromSource
(const
QModelIndex
&
sourceIndex
) const
重实现: QAbstractProxyModel::mapFromSource (const QModelIndex &sourceIndex) const.
[override virtual]
QModelIndex
QTransposeProxyModel::
mapToSource
(const
QModelIndex
&
proxyIndex
) const
重实现: QAbstractProxyModel::mapToSource (const QModelIndex &proxyIndex) const.
[override virtual]
bool
QTransposeProxyModel::
moveColumns
(const
QModelIndex
&
sourceParent
,
int
sourceRow
,
int
count
, const
QModelIndex
&
destinationParent
,
int
destinationChild
)
重实现: QAbstractItemModel::moveColumns (const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild).
[override virtual]
bool
QTransposeProxyModel::
moveRows
(const
QModelIndex
&
sourceParent
,
int
sourceRow
,
int
count
, const
QModelIndex
&
destinationParent
,
int
destinationChild
)
重实现: QAbstractItemModel::moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild).
[override virtual]
QModelIndex
QTransposeProxyModel::
parent
(const
QModelIndex
&
index
) const
重实现: QAbstractItemModel::parent (const QModelIndex &index) const.
[override virtual]
bool
QTransposeProxyModel::
removeColumns
(
int
column
,
int
count
, const
QModelIndex
&
parent
= QModelIndex())
重实现: QAbstractItemModel::removeColumns (int column, int count, const QModelIndex &parent).
[override virtual]
bool
QTransposeProxyModel::
removeRows
(
int
row
,
int
count
, const
QModelIndex
&
parent
= QModelIndex())
重实现: QAbstractItemModel::removeRows (int row, int count, const QModelIndex &parent).
[override virtual]
int
QTransposeProxyModel::
rowCount
(const
QModelIndex
&
parent
= QModelIndex()) const
重实现: QAbstractItemModel::rowCount (const QModelIndex &parent) const.
[override virtual]
bool
QTransposeProxyModel::
setHeaderData
(
int
section
,
Qt::Orientation
orientation
, const
QVariant
&
value
,
int
role
= Qt::EditRole)
重实现: QAbstractProxyModel::setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role).
另请参阅 headerData ().
[override virtual]
bool
QTransposeProxyModel::
setItemData
(const
QModelIndex
&
index
, const
QMap
<
int
,
QVariant
> &
roles
)
重实现: QAbstractProxyModel::setItemData (const QModelIndex &index, const QMap<int, QVariant> &roles).
另请参阅 itemData ().
[override virtual]
void
QTransposeProxyModel::
setSourceModel
(
QAbstractItemModel
*
newSourceModel
)
重实现: QAbstractProxyModel::setSourceModel (QAbstractItemModel *sourceModel).
[override virtual]
void
QTransposeProxyModel::
sort
(
int
column
,
Qt::SortOrder
order
= Qt::AscendingOrder)
重实现: QAbstractProxyModel::sort (int column, Qt::SortOrder order).
This method will perform no action. Use a QSortFilterProxyModel on top of this one if you require sorting.
[override virtual]
QSize
QTransposeProxyModel::
span
(const
QModelIndex
&
index
) const
重实现: QAbstractProxyModel::span (const QModelIndex &index) const.