I am developing an application in Qt (5.10), Linux. It constists of C++, Qml and JavaScript.

I have successfully made a tree structure using TreeView which has clickable rows.
When double clicking on a row, onDoubleClick is handled and a call is made to C++ code to fetch data.
The data is then inserted into the model and then the row will have a + at the beginning of the row.
When clicking the + the row is collapsed and data is visible, can be a few lines or more.
A selected row has by default blue color. The text is black.

All this works perfect but now I have an intention to show when data could not be read, I want the row to be red to indicate failure. The row should stay red after this.
Another thing I want to do is to have some kind of indication when fetching data is ongoing, maybe the row could be purple and when finished loading turn to blue again.

I have tried branchDelegate, rowDelegate, but it seems impossible to make theses changes.

I would be very happy is someone could give me som piece of advice how to go further.