TheIndependentAquarius
11th December 2020, 15:41
I am using TableView of QtQuick.Controls 1.4
This is the rowDelegate. I want to have just the first row of blue colour and rest of the rows (empty or non-empty) of green color.
rowDelegate:
Rectangle
{
border.width: 1
height: 50
width: 2000
color: {
var item = mymodel.get( styleData.row )
if (item.index1 === "1")
return "blue"
return "green"
}
}
Now, my problem is that this code does colour the first row as blue but it also colours the empty rows as blue.
What is the way to solve this problem?
13582
This is the rowDelegate. I want to have just the first row of blue colour and rest of the rows (empty or non-empty) of green color.
rowDelegate:
Rectangle
{
border.width: 1
height: 50
width: 2000
color: {
var item = mymodel.get( styleData.row )
if (item.index1 === "1")
return "blue"
return "green"
}
}
Now, my problem is that this code does colour the first row as blue but it also colours the empty rows as blue.
What is the way to solve this problem?
13582