Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to dynamically change GridView column count?
Forum Updated to NodeBB v4.3 + New Features

How to dynamically change GridView column count?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    allopen
    wrote on 12 Aug 2013, 03:45 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vittalonline
      wrote on 12 Aug 2013, 06:47 last edited by
      #2

      hi Allopen

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

      1 Reply Last reply
      0

      1/2

      12 Aug 2013, 03:45

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved