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. QML listview element restriction vertical
Forum Update on Monday, May 27th 2025

QML listview element restriction vertical

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.5k Views
  • 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.
  • Q Offline
    Q Offline
    qtrahul
    wrote on 16 Oct 2011, 06:05 last edited by
    #1

    How can I make restriction to the QML listview element in vertical order ??

    Is there any way ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on 17 Oct 2011, 01:11 last edited by
      #2

      Hi,

      ListView should be restricted to vertical movement by default. You can control this using the "orientation":http://doc.qt.nokia.com/4.7/qml-listview.html#orientation-prop property.

      Regards,
      Michael

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtrahul
        wrote on 17 Oct 2011, 06:32 last edited by
        #3

        I want my list to be not more than 20 elements in row, means user can add only 20 elements. ?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on 19 Oct 2011, 00:03 last edited by
          #4

          Hi,

          Okay, I misunderstood the original question. ListView itself doesn't restrict the number of items. Most likely you will need to do that at the model or UI level -- e.g. if you control how the user adds elements, you will need to implement your own limit to prevent them adding a 21st item. (also note that if your model always returned a count of <= 20, the ListView would never try to display more than 20 items)

          Regards,
          Michael

          1 Reply Last reply
          0

          1/4

          16 Oct 2011, 06:05

          • Login

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