Skip to content
Permalink
Browse files
fixed issue with MultilineTextPanel in modeler (#10813)
  • Loading branch information
volaya committed Jul 6, 2014
1 parent dcc0171 commit 4df7b3464a8a1e1e40e199fad6994e98a2e7b825
Showing with 10 additions and 10 deletions.
  1. +6 −5 python/plugins/processing/modeler/ModelerParametersDialog.py
  2. +4 −5 python/plugins/processing/modeler/MultilineTextPanel.py
@@ -319,15 +319,16 @@ def getWidgetFromParameter(self, param):
item = MultipleInputPanel(opts)
elif isinstance(param, ParameterString):
strings = self.getAvailableValuesOfType(ParameterString, OutputString)
options = [(self.resolveValueDescription(s), s) for s in strings]
if param.multiline:
item = MultilineTextPanel(strings, self.model)
item.setText(str(param.default))
item = MultilineTextPanel(options)
item.setText(unicode(param.default))
else:
item = QtGui.QComboBox()
item.setEditable(True)
for s in strings:
item.addItem(self.resolveValueDescription(s), s)
item.setEditText(str(param.default))
for desc, val in options:
item.addItem(desc, val)
item.setEditText(unicode(param.default))
elif isinstance(param, ParameterTableField):
item = QtGui.QComboBox()
item.setEditable(True)
@@ -25,24 +25,23 @@

__revision__ = '$Format:%H$'

from PyQt4 import QtCore, QtGui
from PyQt4 import QtGui


class MultilineTextPanel(QtGui.QWidget):

USE_TEXT = 0

def __init__(self, options, model, parent=None):
def __init__(self, options, parent=None):
super(MultilineTextPanel, self).__init__(parent)
self.options = options
self.model = model
self.options = options
self.verticalLayout = QtGui.QVBoxLayout(self)
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
self.combo = QtGui.QComboBox()
self.combo.addItem('[Use text below]')
for option in options:
self.combo.addItem(option.name(), option)
self.combo.addItem(option[0], option[1])
self.combo.setSizePolicy(QtGui.QSizePolicy.Expanding,
QtGui.QSizePolicy.Expanding)
self.verticalLayout.addWidget(self.combo)

0 comments on commit 4df7b34

Please sign in to comment.