KItemModels
kextracolumnsproxymodel.h
27 * Not supported: adding/removing extra columns at runtime; having a different number of columns in subtrees;
30 * Derive from KExtraColumnsProxyModel, call appendColumn (typically in the constructor) for each extra column,
31 * and reimplement extraColumnData() to allow KExtraColumnsProxyModel to retrieve the data to show in the extra columns.
33 * If you want your new column(s) to be somewhere else than at the right of the existing columns, you can
75 * @param row the row number for which the proxy model is querying for data (child of @p parent, if set)
76 * @param extraColumn the number of the extra column, starting at 0 (this doesn't require knowing how many columns the source model has)
80 virtual QVariant extraColumnData(const QModelIndex &parent, int row, int extraColumn, int role = Qt::DisplayRole) const = 0;
90 virtual bool setExtraColumnData(const QModelIndex &parent, int row, int extraColumn, const QVariant &data, int role = Qt::EditRole);
96 void extraColumnDataChanged(const QModelIndex &parent, int row, int extraColumn, const QList<int> &roles);
121 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
131 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
133 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
139 Q_PRIVATE_SLOT(d_func(), void _ec_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &, QAbstractItemModel::LayoutChangeHint))
140 Q_PRIVATE_SLOT(d_func(), void _ec_sourceLayoutChanged(const QList<QPersistentModelIndex> &, QAbstractItemModel::LayoutChangeHint))
This proxy appends extra columns (after all existing columns).
Definition kextracolumnsproxymodel.h:40
virtual QVariant extraColumnData(const QModelIndex &parent, int row, int extraColumn, int role=Qt::DisplayRole) const =0
This method is called by data() for extra columns.
LayoutChangeHint
virtual QModelIndex buddy(const QModelIndex &index) const const override
virtual QVariant data(const QModelIndex &proxyIndex, int role) const const override
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
virtual bool hasChildren(const QModelIndex &parent) const const override
virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override
virtual int columnCount(const QModelIndex &parent) const const override
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const const override
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const override
virtual void setSourceModel(QAbstractItemModel *newSourceModel) override
virtual QModelIndex sibling(int row, int column, const QModelIndex &idx) const const override
QObject * parent() const const
DisplayRole
typedef ItemFlags
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.