Skip to content Skip to sidebar Skip to footer

Qtableview Specify Standard Search Field

I have a QTableView with the following code below. It runs fine, but when I am typing the search field is always the first column, which is the number and primary key. How can I ch

Solution 1:

You need to change the index as follows:

# index: the index of a cell in the desired column
index = tableView.model().index(0, 1)
tableView.selectionModel().setCurrentIndex(index, QItemSelectionModel.NoUpdate);

Post a Comment for "Qtableview Specify Standard Search Field"