Answer the question
In order to leave comments, you need to log in
How to add button to item QListView?
There is a widget based on QListView to display the model. The model is based on QAbstractListModel.
Essentially a list of files is displayed. It is necessary to implement a button for each displayed item in the list. (I want a "cross" like in a QtCreator widget that displays a list of open documents)
Answer the question
In order to leave comments, you need to log in
QListView inherits from QAbstractItemView, and the latter has the ability to set delegates for custom cells:
// Для всех ячеек.
void setItemDelegate(QAbstractItemDelegate * delegate)
// Для колонки.
void setItemDelegateForColumn(int column, QAbstractItemDelegate * delegate)
// Для строки.
void setItemDelegateForRow(int row, QAbstractItemDelegate * delegate)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question