Add possible workaround for model invalidate().

This commit is contained in:
Florian Bruhin 2014-02-04 20:59:39 +01:00
parent a0bcfe1960
commit 1f6ae3e0ed
2 changed files with 7 additions and 4 deletions

View File

@ -314,10 +314,7 @@ class CompletionFilterModel(QSortFilterProxyModel):
srcmodel.sort(sortcol) srcmodel.sort(sortcol)
except NotImplementedError: except NotImplementedError:
self.sort(sortcol) self.sort(sortcol)
# FIXME we should call self.invalidate() here so sorting actually works. self.invalidate()
# However, this seems to provoke a lot of weird problems, like
# random race condition segfaults :(
# self.invalidate()
def filterAcceptsRow(self, row, parent): def filterAcceptsRow(self, row, parent):
"""Custom filter implementation. """Custom filter implementation.

View File

@ -80,6 +80,12 @@ class CompletionView(QTreeView):
self.setHeaderHidden(True) self.setHeaderHidden(True)
self.setIndentation(0) self.setIndentation(0)
self.setItemsExpandable(False) self.setItemsExpandable(False)
# FIXME This is a workaround for weird race conditions with invalid
# item indexes leading to segfaults in Qt.
#
# Some background: http://bugs.quassel-irc.org/issues/663
# The proposed fix there was later reverted because it didn't help.
self.setUniformRowHeights(True)
self.hide() self.hide()
# FIXME set elidemode # FIXME set elidemode