diff --git a/manuskript/models/characterPOVModel.py b/manuskript/models/characterPOVModel.py index fbbe419e..03309a71 100644 --- a/manuskript/models/characterPOVModel.py +++ b/manuskript/models/characterPOVModel.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # --!-- coding: utf8 --!-- from PyQt5.QtCore import QModelIndex, QSortFilterProxyModel - +from manuskript.enums import Character as C class characterPOVModel(QSortFilterProxyModel): @@ -14,7 +14,11 @@ class characterPOVModel(QSortFilterProxyModel): sourceModel.dataChanged.connect(self.sourceDataChanged) def filterAcceptsRow(self, sourceRow, sourceParent): - return self.sourceModel().pov(sourceRow) + # Although I would prefer to reuse the existing characterModel.pov() method, + # this is simpler to do, actually works and also more ideomatic Qt code. + index = self.sourceModel().index(sourceRow, C.pov.value, sourceParent) + value = self.sourceModel().data(index) + return bool(value) def rowToSource(self, row): index = self.index(row, 0)