TreeView model styling: How to display multiple role names (columns)?
-
Hello,
I'm at a lost here, I just can't find the answer in the documentation.
I have a treeview with a C++ model (based on QAbstractItemModel, of course). The data displays fine but now I want to provide a better style to it, which I can't due to the implicit nature of Qt Quick controls/QML in general I just don't know how to make a simple "Product name (20% off, was [product regular price]) per row.
It's a very basic structure. A model with a row containing (id, product name, price, discount) etc. I want to provide a better styling but I can't find a way to mix different role names (data per column).
I've found a few possible answers through googling and stackoverflow, but nothing concrete yet.
-
@David.G AFAIK one way would be to return the data as required from re-implemented
data
function.