i'm sure you can ask here
thank you I have tableview as follows: self.table= QTableView() self.model =QSqlRelationalTableModel(self) i have defined two columns as a foreign key as follows: self.model.setRelation(1, QSqlRelation("Names", "nameOfCm", "nameOfCm")) self.model.setRelation(2, QSqlRelation("Types", "type_IDs", "typeOfCm")) in column No 1 i have items like IC, Transistor, etc. in column No 2 i have items like timer, op_amp, BJT, IGBT,etc. items in column 2 are subset of items in column 1 for example op_amp and timer are subset of IC. BJT and IGBT are subset of transistor. by using above two command a combobox appears in column no 1 and no 2 and you can choose from there. but i want to be in such a way that column 2 only shows the relevant subset of item chosen in column 1. now it shows all items regardless of what you have chosen in column 1. the command below can filter the results but i don't know how i can tell the filter what i have chosen in previous column: self.model.relationModel(2).setFilter("type_IDs like 'D%'") Sorry for Long Question😅😅
Обсуждают сегодня