I'm looking to essentially replicate this:
What is the most appropriate Qt container widget for displaying my custom widgets containing image+subscript? I'm looking at QTableView
and it seems to be supposed to have a set number of rows/columns, while I would like my program to change layout depending on window width (so that there is no horizontal scroll), and adding new widget should be done with addWidget(QWidget * w)
, not setWidget(int row, int column, QWidget * w)
. Is there a better component for this than QTableView (which requires much coding for my task)?
Best Answer
You should use
QListWidget
(orQListView
and subclassQAbstractItemModel
) and set it's view mode toIconMode
.Example :
Result :