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. Some questions about qml and sqlite javascript parsing
Forum Updated to NodeBB v4.3 + New Features

Some questions about qml and sqlite javascript parsing

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 1.6k 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.
  • M Offline
    M Offline
    mmlabeeb
    wrote on 7 Sept 2012, 21:59 last edited by
    #1

    Suppose the part of my code for parsing all tables from a database called 'databaseName' is, (in Javascript)
    @
    var rs = tx.executeSql('SELECT * FROM namesTable ORDER BY id ASC');
    @

    And my 'namesTable' would look like this
    @
    id name City Country
    1 "James" NY USA
    2 "Frank" KZ GBA
    3 "Don" KR IN
    @

    1) what would be the value of "rs"? I want to know how that object look like.
    Is it represented in javascript like below ? Or in any other method?
    @
    rs = {{id:"1", name:"James", City:"NY", Country: "USA"},
    {id:"2", name:"Frank", City:"KZ", Country: "GBA"},
    {id:"4", name:"DOn", City:"KR", Country: "IN"}}
    @

    2) Whichever way, What would be the notation to read data from this from a QML file?
    (if i map rerturn "rs" from javascript to an object "obj" in QML, how can i get the individual values?
    eg: obj["1"].name ? )

    3) And how can i put the values of this table in a Listmodel?

    1 Reply Last reply
    0

    1/1

    7 Sept 2012, 21:59

    • Login

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