Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Repaint QListWidget's icons when resizing



  • Hello.

    I have a problem with a QListWidget in icon mode : at startup, the icons are painted so as they take the maximal width of the widget. But when the QListWidget is resized, the icons keep the same location whereas there is more available horizontal space to dispose them. Is this a normal behaviour of QListWidget? Is there any way to draw the icons again when the widget is resized?

    Dvassily.


  • Lifetime Qt Champion

    The behavior is correct - or does e.g. your file explorer automatically resizes the icons when there is more spaces available.
    I think you're looking for QListView::gridSize(). Make sure the icons you use are available in the desired size.


Log in to reply