Fix updating QTableView on input

* When clicking on the test regex button or editing the test input field, the tableView doesn't update its data properly.
* Somehow QTableView.update() doesn't request the data from the model.
* The workaround is to call refresh on the model directly, which will in turn update its view.
This commit is contained in:
glubsy 2020-12-30 23:18:42 +01:00
parent b138dfad33
commit 5553414205
1 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class ExcludeListDialog(QDialog):
return return
# if at least one row matched, we know whether table is highlighted or not # if at least one row matched, we know whether table is highlighted or not
self._row_matched = self.model.test_string(input_text) self._row_matched = self.model.test_string(input_text)
self.tableView.update() self.table.refresh()
input_regex = self.inputLine.text() input_regex = self.inputLine.text()
if not input_regex: if not input_regex:
@ -146,7 +146,7 @@ class ExcludeListDialog(QDialog):
if self._row_matched: if self._row_matched:
self._row_matched = False self._row_matched = False
self.model.reset_rows_highlight() self.model.reset_rows_highlight()
self.tableView.update() self.table.refresh()
def display_help_message(self): def display_help_message(self):
self.app.show_message(tr("""\ self.app.show_message(tr("""\