I am using QTableView to display data retrieved from QtSql.QSqlQuery
I want to know how can i create filters for it like in excel.

In the above image i need to get the filters for All heders (Sh_Code,SH_Seq,Stage)
The filters will have unique values in of that column on which we can filter.
Required result
I need the Table view header with a dropbox listing all unique values in that column just like in excel below. No need of Top,Standard filter… as shown in image. Need only “All” and the unique “column items”

This is from my .NET application, uploaded for more clarity

Here is an example of filtering in PyQt using
QSortFilterProxyModel,QStandardItemModelandQTableView, it can be easily adapted to other views and models:To get required results, a popup menu is launched by clicking on the header, and populated with the unique values for that column. Once an item in the popup menu is selected, the value is passed to
self.proxy.setFilterRegExp(filterString)and the column toself.proxy.setFilterKeyColumn(filterValue).