Answer the question
In order to leave comments, you need to log in
Strange behavior of Python + PySide. How to change data recursively in QSortFilterProxyModel()?
Hello! Help me to understand.
From model = QSqlTableModel()
I receive the table with some quantity of fields.
Next, I put a filter on it:
def update_list(): тут пытаюсь заменить все значения "значение_1" на "значение_2" во второй колонке
i = 0 #счетцик
while i < model_list.rowCount():
model_list.setData(model_list.index(i, 2), 'значение_2') в этом моменте происходит магия. см. ниже
print ('счетчик ',i)
i = i+1
print ('количество строк',model_list.rowCount())
model.select()
print('Обновление')
model_list = QSortFilterProxyModel()
model_list.setSourceModel(model)
model_list.setFilterCaseSensitivity(Qt.CaseInsensitive)
model_list.setFilterKeyColumn(2)
model_list.setFilterFixedString('значение_1')
update_list()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question