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. CardView with model
Qt 6.11 is out! See what's new in the release blog

CardView with model

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 3.7k 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.
  • B Offline
    B Offline
    BerndS
    wrote on last edited by
    #1

    Hi,

    is there a way to display a model (e.g. QStandardItemModel) in some sort of cardview like the task menu of WebOS? It should be a horizontal list and if I swipe to left or right the previous or next item of the model should be shown.

    Any ideas?

    thx

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      One approach would be to make a very simple QML component utilising a ListView element. Then you can embed this in either your QML scene or instantiate it using QDeclarativeView if you are using a widget based UI.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BerndS
        wrote on last edited by
        #3

        Thank you for your reply.
        I am not sure if I understand this correctly but a ListView scrolls vertically as far as I know.

        The image below shows the card views of WebOS. Each card should be based on a simple qml file but with different content (from the model)

        !http://www.nexave.de/nachrichten/wp-content/uploads/2009/02/unbenannt-5.jpg(WebOS)!

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          You can set a ListView to horizontal.

          @
          ListView {
          id: myList
          orientation: Horizontal
          ...
          }
          @

          WIth a suitable delegate that should get the effect you are after.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • B Offline
            B Offline
            BerndS
            wrote on last edited by
            #5

            Thank you very much. Sounds good.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              Another option is a PathView but that is more appropriate when you want something other than linear motion of the items.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              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