Three options

1) use an item delegate that uses the ownership value and decides how to draw on that
2) derive from QSqlQueryModel and reimplement data() to answer for the alignment role and background role depending on the value of ownership
3) do the same thing with a class derived from QIdentityProxyModel with the QSqlQueryModel as the source.

Cheers,
_