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

QML listview element restriction vertical

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.5k 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.
  • Q Offline
    Q Offline
    qtrahul
    wrote on 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 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 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 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

          • Login

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