Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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



  • solved I forgot to remove "listView.model.clear()" after my save function


Log in to reply