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.

Qt Code:
  1. rowDelegate:
  2. Rectangle
  3. {
  4. border.width: 1
  5. height: 50
  6. width: 2000
  7.  
  8. color: {
  9. var item = mymodel.get( styleData.row )
  10.  
  11. if (item.index1 === "1")
  12. return "blue"
  13.  
  14. return "green"
  15.  
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 
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?

Screenshot from 2020-12-11 20-41-06.jpg