I have a QListView with IconMode view, LeftToRight flow, and wrapping is true.
But I have a problem when I resize the widget that the item is not relayout.
Is there any way to make it relayout? Many thanks for any help.
Start listview :
List view after resize :
You need to set the resize mode
setResizeMode(QListView::Adjust)
The default is "Fixed" not "Adjust"
Look here: https://doc.qt.io/qt-5/qlistview.html#resizeMode-prop
And: https://doc.qt.io/qt-5/qlistview.html#ResizeMode-enum
And:https://doc.qt.io/qt-4.8/qlistview.html#isWrapping-prop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With