Commits

David Townshend committed b81f234

Fix for a PySide bug where it iterates over the result of model.data().

Comments (0)

Files changed (2)

qte/_delegates.py

         return widget
 
     def setEditorData(self, editor, index):
-        value = index.data(_qt.Qt.EditRole)
+        value = index.model().data(index, _qt.Qt.EditRole)
         editor.setValue(value)
 
     def setModelData(self, editor, model, index):

qte/_sortfilterproxymodel.py

         if model is not None:
             self.setSourceModel(model)
 
+    def data(self, index, role):
+        # Fix some perculiar PySide bug where it iterates over the result.
+        return self.sourceModel().data(self.mapToSource(index), role)
+
     def filterFunction(self, column:'column'):
         """
         Return the filter function and role as set by `setFilterFunction`.