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. ListView delegate's property is converted from an array to QQmlListModel
Forum Updated to NodeBB v4.3 + New Features

ListView delegate's property is converted from an array to QQmlListModel

Scheduled Pinned Locked Moved QML and Qt Quick
qqmllistmodeltypeerrorlistviewlistmodel
1 Posts 1 Posters 1.1k 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.
  • P Offline
    P Offline
    Pheelbert
    wrote on last edited by Pheelbert
    #1

    A similar thread I believe: https://forum.qt.io/topic/41710/enginio-backend-type-array-cannnot-be-converted-to-json-in-client

    [...]
    var object = {};
    object.delegateName = name;
    object.delegateArray = [];
    listView.model.append(object);
    [...]
    

    The array ([]) is converted to a QQmlListModel when I try to access it it from the delegate, therefore I get this error:
    TypeError: Property 'push' of object QQmlListModel(0x7fc9ad9b9340) is not a function

    1 Reply Last reply
    1

    • Login

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