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. TableView text color change work but with an error message, why?
Forum Updated to NodeBB v4.3 + New Features

TableView text color change work but with an error message, why?

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

    Hello, I'm using code below in QML to change the text color if condition:

    itemDelegate: Text {
                      anchors.verticalCenter: parent.verticalCenter
                         color: listModel.get(styleData.row).activecheck === "inactive" ? "lightgrey": "black"
                         text: styleData.value
                    }
    

    it's working but I receive the error message :

    TypeError: Cannot read property 'activecheck' of undefined

    Do you know how can I solve that?

    Thank you very much

    1 Reply Last reply
    0
    • F Offline
      F Offline
      filipdns
      wrote on last edited by
      #2

      solved I forgot to remove "listView.model.clear()" after my save 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