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. Create QML TableView from JS array best way. How?
Qt 6.11 is out! See what's new in the release blog

Create QML TableView from JS array best way. How?

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

    Hello all!

    How to make QML TableView if I have something like this in JS:

    var oData = [
        [1,2,3,4,5,6,7,8],
        [1,2,3,4,5,6,7,8],
        [1,2,3,4,5,6,7,8],
        [1,2,3,4,5,6,7,8],
        [1,2,3,4,5,6,7,8],
    ];
    

    Or if my custom model return by index something like this:

    [[1,2,3,4,5,6,7,8]]
    

    The key point - there are nothing about roles, there are just one role where inside JavaScript Array (QVariantList).

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote on last edited by
      #2

      Issue closed. Solution found. Example published here Be careful when using this kind of approach. There are a lot of memory will be used.

      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