Skip to content
Permalink
Browse files

Merge pull request #1897 from arnaud-morvan/fix_fieldsmapper

[processing] Fix fieldsmapper
  • Loading branch information
volaya committed Feb 12, 2015
2 parents b26556e + 3c93827 commit 7a0d04103b459fe36f84f7571cd5a417922e980a
Showing with 6 additions and 5 deletions.
  1. +6 −5 python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
@@ -132,7 +132,7 @@ def data(self, index, role=QtCore.Qt.DisplayRole):

fieldType = column_def['type']
if fieldType == QtCore.QVariant.Type:
if value == 0:
if value == QtCore.QVariant.Invalid:
return ''
return self.fieldTypes[value]
return value
@@ -243,7 +243,7 @@ def createEditor(self, parent, option, index):
elif fieldType == QgsExpression:
editor = QgsFieldExpressionWidget(parent)
editor.setLayer(index.model().layer())
# editor.fieldChanged.connect(self.on_expression_fieldChange)
editor.fieldChanged.connect(self.on_expression_fieldChange)

else:
editor = QtGui.QStyledItemDelegate.createEditor(self, parent, option, index)
@@ -277,6 +277,8 @@ def setModelData(self, editor, model, index):
fieldType = FieldsMappingModel.columns[column]['type']
if fieldType == QtCore.QVariant.Type:
value = editor.itemData(editor.currentIndex())
if value is None:
value = QtCore.QVariant.Invalid
model.setData(index, value)

elif fieldType == QgsExpression:
@@ -289,9 +291,8 @@ def setModelData(self, editor, model, index):
def updateEditorGeometry(self, editor, option, index):
editor.setGeometry(option.rect)

def on_expression_fieldChange(self, fieldName, isValid):
# self.commitData.emit(self.sender())
pass
def on_expression_fieldChange(self, fieldName):
self.commitData.emit(self.sender())


class FieldsMappingPanel(QtGui.QWidget, Ui_Form):

0 comments on commit 7a0d041

Please sign in to comment.
You can’t perform that action at this time.