5 |
5 |
6 """ |
6 """ |
7 Module implementing a special completer for the history. |
7 Module implementing a special completer for the history. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt, QRegExp, QTimer, qVersion |
10 from PyQt4.QtCore import Qt, QRegExp, QTimer |
11 from PyQt4.QtGui import QTableView, QAbstractItemView, QSortFilterProxyModel, \ |
11 from PyQt4.QtGui import QTableView, QAbstractItemView, QSortFilterProxyModel, \ |
12 QCompleter |
12 QCompleter |
13 |
13 |
14 from .HistoryModel import HistoryModel |
14 from .HistoryModel import HistoryModel |
15 from .HistoryFilterModel import HistoryFilterModel |
15 from .HistoryFilterModel import HistoryFilterModel |
145 return |
145 return |
146 |
146 |
147 self.__isValid = valid |
147 self.__isValid = valid |
148 |
148 |
149 # tell the history completer that the model has changed |
149 # tell the history completer that the model has changed |
150 if qVersion() >= "5.0.0": |
150 self.dataChanged.emit(self.index(0, 0), self.index(0, self.rowCount() - 1)) |
151 self.dataChanged.emit(self.index(0, 0), |
|
152 self.index(0, self.rowCount() - 1), []) |
|
153 else: |
|
154 self.dataChanged.emit(self.index(0, 0), self.index(0, self.rowCount() - 1)) |
|
155 |
151 |
156 def filterAcceptsRow(self, sourceRow, sourceParent): |
152 def filterAcceptsRow(self, sourceRow, sourceParent): |
157 """ |
153 """ |
158 Protected method to determine, if the row is acceptable. |
154 Protected method to determine, if the row is acceptable. |
159 |
155 |