How to set selected text colour, style in Qtableview string Below is a small working code to diplay what I am trying to achieve.