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.
As per the answer from @user1006989 & @Behzad Jamali: The menu position for filtering on header won't popup at the exact position if the table has more columns than the current view port.
To have a correct positioning of the popup menu, use this line
posX = headerPos.x() + self.horizontalHeader.sectionViewportPosition(index)