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. "Error: Cannot assign to read-only property" in delegate
Forum Updated to NodeBB v4.3 + New Features

"Error: Cannot assign to read-only property" in delegate

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.
  • W Offline
    W Offline
    wspilot
    wrote on last edited by
    #1

    Hi,
    Qt 4.8/Sailfish-Ubuntu
    I have two Listviews in QML.
    Both are set via C++ ():
    @rootContext()->setContextProperty("myCheckListHeadings", QVariant::fromValue(clHandling->checkListHeadings) );//data
    rootContext()->setContextProperty("myCheckListItems", QVariant::fromValue(clHandling->checkItems) );//data
    checkListHeadings.append(new CheckListItem(chked, clName));
    checkItems.append(new CheckListItem(chked1, line));
    @
    chked, clName and chked1, line are valid bool(false)/QString values
    etc.
    Both listviews are filled with the data from C++.
    Both listviews have delegates with:
    (MouseArea) Onclicked:
    @checked is true
    @

    In the first list checked is indeed set to true,
    the second list generates error:
    @
    Error: Cannot assign to read-only property "checked"
    @

    I have seen bug reports on this issue, but it is unclear if it was solved.
    Also strange that one list is working OK, and the other fails.
    Any hints?
    Thanks.

    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