A、レンダリング
2、コードキー
1 QAbstractListModelの継承、書き換え可能
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex &index) const;
QStyledItemDelegate、書き換え塗料は各項目のカスタム描画を行うことができます。2. Aの後継者
void paint(QPainter *painter,
const QStyleOptionViewItem &option, const QModelIndex &index) const override;
第三に、要約
1.QListView項目は、データとcolumnCountのに基づいて、それぞれのユニークなQModelIndexをrowCountのために作成されます。
各データ項目塗料用ユニットを通って引き込ま2.QStyledItemDelegate