That doesn't sounds so difficult on first sight.
Your model reports a rowCount() that is one up from what you have actual data for, thus displaying an empty row at the end.
In your row data structure you have a flag that marks that row as either valid or invalid.
Your data() method uses this to return the respective background color.
Cheers,
_
Bookmarks