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. Nested TableView
Forum Updated to NodeBB v4.3 + New Features

Nested TableView

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 771 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.
  • F Offline
    F Offline
    Fheanor
    wrote on last edited by
    #1

    Hello,

    I would like to created a nested TableView for some elements of my main TableView.
    alt text

    For example, if Rowtitle == ""Brilliance" , I would like to created a subTableView for this row.

    ListModel {
        id: libraryModel
        ListElement {
            title: "A Masterpiece"
            author: "Gabriel"
        }
        ListElement {
            title: "Brilliance"
            author: "Jens"
        }
        ListElement {
            title: "Outstanding"
            author: "Frederik"
        }
    }
    TableView {
        TableViewColumn {
            role: "title"
            title: "Title"
            width: 100
           //if title==""Brilliance" create a second tableview
        }
        TableViewColumn {
            role: "author"
            title: "Author"
            width: 200
        }
        model: libraryModel
    }
    

    Do you have any idea how to do it ?

    Thanks a lot !

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kofr
      wrote on last edited by
      #2

      How about using TreeView? You can also use Loader as delegate if you need customization.
      b.t.w treeView is quite buggy and for some reason is being ignored by Qt bug fixers. If this stops you of using TreeView, so far I know TableView has similar bugs.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fheanor
        wrote on last edited by
        #3

        Hello, thanks for your answer.
        I am thinking of using TreeView but my code might change a lot and I just need for some elements to have a nested list of one level so I wanted to know if there was a simple way to do it.

        This how my data should be most of the time:

        0_1492603125458_upload-171d7e52-fb52-4af9-88b0-9d5cdc4c3a29

        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