Some documentation is missing. Inside the element delegate, you can access the following (taken from the source code of TreeView.qml ):
styleData ( see documentation )model (not currently registered)modelData (not currently registered, not sure about this, but I think it looks like a ListView )
(By the way, what is missing in the documentation, but useful is styleData.role . In addition, the documentation of other delegates also lacks some of the available properties, it is best to look at the source code of the QML file and look at the Loader element that creates the instance of your delegate. As a plus you will learn how this creepy stuff works.))
With model and column / column information, you can go to element data. This code depends on the type of model.
If you use QML ListModel , you can use model.get : model.get(styleData.row)[styleData.role] should work (unchecked since I use it rarely, please report it).
If you use C ++ QAbstractItemModel or friends, it is best to add a slot to the model class, which accepts only the row and role name, since the information the TableView works with (as well as role numbers and columns ...).
However, in both cases, you should not use the expression in a property binding! The notification system will not work, since you are not using the property system to access data. On your question, I think you wanted to use it in a binding expression. I do not know how to listen to changes in the model manually.
An alternative approach is to access other elements of the line and provide their property there. Some tips:
From one element, you can access other elements of the same line by double-walking through the tree of objects (first to the loader that creates an instance of your component, and then to the actual line), and then twice down (first, the specific child object that is the loader, and then its instance of the object). You need to know the column number you want to get (not the role name), I assume that you want to access the first column (index 0):
parent.parent.children[0].item
You can provide model data using the property in each element. Assuming a simple text element, this could be:
Text { property variant value: styleData.value
Combining them may look as follows. In this example, I assume that the first row contains an integer, and if it is zero, the second column should be red.
// (within TableView) itemDelegate: Text { property variant value: styleData.value text: styleData.value color: (styleData.column == 1 && parent.parent.children[0].item.value === 0) "red" : "black" }