Important: Please read the Qt Code of Conduct -

How to dynamically change GridView column count?

  • I used a GridView with 3 columns, and I want to change che column count dynamically via user button click.
    At first, I change the grid.cellWidth to change the columns, for example, if user want to display 2 columns, the code is:

    @grid.cellWidth = grid.width/2;

    but after this, when the user resize the Desktop window, the cells won't change size.
    what did i miss?

  • hi Allopen

    QWidget::resizeEvent() which you can reimplement in your widget.In this you can change the grid.celwidth.

Log in to reply