mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[processing] use checkbox for boolean parameters
This commit is contained in:
parent
986bd1c41a
commit
ace704a424
@ -10,7 +10,8 @@
|
||||
Email : volayaf at gmail dot com
|
||||
otb at c-s dot fr (CS SI)
|
||||
Contributors : Victor Olaya
|
||||
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
|
||||
Alexia Mondot (CS SI) - managing the new parameter
|
||||
ParameterMultipleExternalInput
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -32,7 +33,7 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||
from PyQt4.QtWebKit import *
|
||||
|
||||
from processing.core.ProcessingLog import ProcessingLog
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
@ -45,7 +46,7 @@ from processing.core.outputs import OutputTable
|
||||
from processing.tools import dataobjects
|
||||
from qgis.utils import iface
|
||||
|
||||
class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
class AlgorithmExecutionDialog(QDialog):
|
||||
|
||||
class InvalidParameterValue(Exception):
|
||||
|
||||
@ -53,37 +54,36 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
(self.parameter, self.widget) = (param, widget)
|
||||
|
||||
def __init__(self, alg, mainWidget):
|
||||
QtGui.QDialog.__init__(self, iface.mainWindow(), QtCore.Qt.WindowSystemMenuHint
|
||||
| QtCore.Qt.WindowTitleHint)
|
||||
QDialog.__init__(self, iface.mainWindow(),
|
||||
Qt.WindowSystemMenuHint | Qt.WindowTitleHint)
|
||||
self.executed = False
|
||||
self.mainWidget = mainWidget
|
||||
self.alg = alg
|
||||
self.resize(650, 450)
|
||||
self.buttonBox = QtGui.QDialogButtonBox()
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close)
|
||||
self.runButton = QtGui.QPushButton()
|
||||
self.buttonBox = QDialogButtonBox()
|
||||
self.buttonBox.setOrientation(Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Close)
|
||||
self.runButton = QPushButton()
|
||||
self.runButton.setText('Run')
|
||||
self.buttonBox.addButton(self.runButton,
|
||||
QtGui.QDialogButtonBox.ActionRole)
|
||||
self.buttonBox.addButton(self.runButton, QDialogButtonBox.ActionRole)
|
||||
self.runButton.clicked.connect(self.accept)
|
||||
self.setWindowTitle(self.alg.name)
|
||||
self.progressLabel = QtGui.QLabel()
|
||||
self.progress = QtGui.QProgressBar()
|
||||
self.progressLabel = QLabel()
|
||||
self.progress = QProgressBar()
|
||||
self.progress.setMinimum(0)
|
||||
self.progress.setMaximum(100)
|
||||
self.progress.setValue(0)
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self)
|
||||
self.verticalLayout = QVBoxLayout(self)
|
||||
self.verticalLayout.setSpacing(6)
|
||||
self.verticalLayout.setMargin(9)
|
||||
self.tabWidget = QtGui.QTabWidget()
|
||||
self.tabWidget = QTabWidget()
|
||||
self.tabWidget.setMinimumWidth(300)
|
||||
self.tabWidget.addTab(self.mainWidget, 'Parameters')
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
self.logText = QTextEdit()
|
||||
self.logText.readOnly = True
|
||||
self.tabWidget.addTab(self.logText, 'Log')
|
||||
self.webView = QtWebKit.QWebView()
|
||||
self.webView = QWebView()
|
||||
html = None
|
||||
url = None
|
||||
isText, help = self.alg.help()
|
||||
@ -91,7 +91,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
if isText:
|
||||
html = help;
|
||||
else:
|
||||
url = QtCore.QUrl(help)
|
||||
url = QUrl(help)
|
||||
else:
|
||||
html = '<h2>Sorry, no help is available for this \
|
||||
algorithm.</h2>'
|
||||
@ -121,17 +121,17 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
continue
|
||||
if isinstance(param, ParameterExtent):
|
||||
continue
|
||||
if not self.setParamValue(param,
|
||||
self.paramTable.valueItems[param.name]):
|
||||
if not self.setParamValue(
|
||||
param, self.paramTable.valueItems[param.name]):
|
||||
raise AlgorithmExecutionDialog.InvalidParameterValue(param,
|
||||
self.paramTable.valueItems[param.name])
|
||||
|
||||
for param in params:
|
||||
if isinstance(param, ParameterExtent):
|
||||
if not self.setParamValue(param,
|
||||
self.paramTable.valueItems[param.name]):
|
||||
raise AlgorithmExecutionDialog.InvalidParameterValue(param,
|
||||
self.paramTable.valueItems[param.name])
|
||||
if not self.setParamValue(
|
||||
param, self.paramTable.valueItems[param.name]):
|
||||
raise AlgorithmExecutionDialog.InvalidParameterValue(
|
||||
param, self.paramTable.valueItems[param.name])
|
||||
|
||||
for output in outputs:
|
||||
if output.hidden:
|
||||
@ -158,7 +158,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
except:
|
||||
return param.setValue(widget.getValue())
|
||||
elif isinstance(param, ParameterBoolean):
|
||||
return param.setValue(widget.currentIndex() == 0)
|
||||
return param.setValue(widget.isChecked())
|
||||
elif isinstance(param, ParameterSelection):
|
||||
return param.setValue(widget.currentIndex())
|
||||
elif isinstance(param, ParameterFixedTable):
|
||||
@ -199,9 +199,9 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
'Layers do not all use the same CRS.\n'
|
||||
+ 'This can cause unexpected results.\n'
|
||||
+ 'Do you want to continue?',
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
|
||||
QtGui.QMessageBox.No)
|
||||
if reply == QtGui.QMessageBox.No:
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QMessageBox.No)
|
||||
if reply == QMessageBox.No:
|
||||
return
|
||||
msg = self.alg.checkParameterValuesBeforeExecuting()
|
||||
if msg:
|
||||
@ -209,7 +209,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
return
|
||||
self.runButton.setEnabled(False)
|
||||
self.buttonBox.button(
|
||||
QtGui.QDialogButtonBox.Close).setEnabled(False)
|
||||
QDialogButtonBox.Close).setEnabled(False)
|
||||
buttons = self.paramTable.iterateButtons
|
||||
self.iterateParam = None
|
||||
|
||||
@ -289,7 +289,7 @@ class AlgorithmExecutionDialog(QtGui.QDialog):
|
||||
self.progress.setMaximum(100)
|
||||
self.progress.setValue(0)
|
||||
self.runButton.setEnabled(True)
|
||||
self.buttonBox.button(QtGui.QDialogButtonBox.Close).setEnabled(True)
|
||||
self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
|
||||
|
||||
def setInfo(self, msg, error=False):
|
||||
if error:
|
||||
|
@ -10,7 +10,8 @@
|
||||
Email : volayaf at gmail dot com
|
||||
otb at c-s dot fr (CS SI)
|
||||
Contributors : Victor Olaya
|
||||
Alexia Mondot (CS SI) - managing the new parameter ParameterMultipleExternalInput
|
||||
Alexia Mondot (CS SI) - managing the new parameter
|
||||
ParameterMultipleExternalInput
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@ -32,9 +33,9 @@ __revision__ = '$Format:%H$'
|
||||
import os
|
||||
import locale
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
from processing.tools import dataobjects
|
||||
from processing.core.ProcessingConfig import ProcessingConfig
|
||||
|
||||
from processing.gui.OutputSelectionPanel import OutputSelectionPanel
|
||||
@ -65,8 +66,10 @@ from processing.core.outputs import OutputRaster
|
||||
from processing.core.outputs import OutputTable
|
||||
from processing.core.outputs import OutputVector
|
||||
|
||||
from processing.tools import dataobjects
|
||||
|
||||
class ParametersPanel(QtGui.QWidget):
|
||||
|
||||
class ParametersPanel(QWidget):
|
||||
|
||||
NOT_SELECTED = '[Not selected]'
|
||||
|
||||
@ -85,19 +88,18 @@ class ParametersPanel(QtGui.QWidget):
|
||||
|
||||
def initGUI(self):
|
||||
tooltips = self.alg.getParameterDescriptions()
|
||||
self.setSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Expanding)
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.setSizePolicy(QSizePolicy.Expanding,
|
||||
QSizePolicy.Expanding)
|
||||
self.verticalLayout = QVBoxLayout()
|
||||
self.verticalLayout.setSpacing(5)
|
||||
self.verticalLayout.setMargin(20)
|
||||
for param in self.alg.parameters:
|
||||
if param.isAdvanced:
|
||||
self.advancedButton = QtGui.QPushButton()
|
||||
self.advancedButton = QPushButton()
|
||||
self.advancedButton.setText('Show advanced parameters')
|
||||
self.advancedButton.setMaximumWidth(250)
|
||||
QtCore.QObject.connect(self.advancedButton,
|
||||
QtCore.SIGNAL('clicked()'),
|
||||
self.showAdvancedParametersClicked)
|
||||
self.advancedButton.clicked.connect(
|
||||
self.showAdvancedParametersClicked)
|
||||
self.verticalLayout.addWidget(self.advancedButton)
|
||||
break
|
||||
for param in self.alg.parameters:
|
||||
@ -111,18 +113,17 @@ class ParametersPanel(QtGui.QWidget):
|
||||
desc += ' [optional]'
|
||||
except:
|
||||
pass
|
||||
label = QtGui.QLabel(desc)
|
||||
self.labels[param.name] = label
|
||||
widget = self.getWidgetFromParameter(param)
|
||||
self.valueItems[param.name] = widget
|
||||
if isinstance(param, ParameterVector) \
|
||||
and not self.alg.allowOnlyOpenedLayers:
|
||||
layout = QtGui.QHBoxLayout()
|
||||
|
||||
if isinstance(param, ParameterVector) and \
|
||||
not self.alg.allowOnlyOpenedLayers:
|
||||
layout = QHBoxLayout()
|
||||
layout.setSpacing(2)
|
||||
layout.setMargin(0)
|
||||
layout.addWidget(widget)
|
||||
button = QtGui.QToolButton()
|
||||
icon = QtGui.QIcon(os.path.dirname(__file__)
|
||||
button = QToolButton()
|
||||
icon = QIcon(os.path.dirname(__file__)
|
||||
+ '/../images/iterate.png')
|
||||
button.setIcon(icon)
|
||||
button.setToolTip('Iterate over this layer')
|
||||
@ -131,32 +132,43 @@ class ParametersPanel(QtGui.QWidget):
|
||||
button.setMaximumHeight(30)
|
||||
layout.addWidget(button)
|
||||
self.iterateButtons[param.name] = button
|
||||
QtCore.QObject.connect(button, QtCore.SIGNAL('toggled(bool)'),
|
||||
self.buttonToggled)
|
||||
widget = QtGui.QWidget()
|
||||
button.toggled.connect(self.buttonToggled)
|
||||
widget = QWidget()
|
||||
widget.setLayout(layout)
|
||||
|
||||
if param.name in tooltips.keys():
|
||||
tooltip = tooltips[param.name]
|
||||
else:
|
||||
tooltip = param.description
|
||||
label.setToolTip(tooltip)
|
||||
|
||||
widget.setToolTip(tooltip)
|
||||
if param.isAdvanced:
|
||||
label.setVisible(self.showAdvanced)
|
||||
widget.setVisible(self.showAdvanced)
|
||||
self.widgets[param.name] = widget
|
||||
self.verticalLayout.addWidget(label)
|
||||
|
||||
if isinstance(param, ParameterBoolean):
|
||||
widget.setText(desc)
|
||||
if param.isAdvanced:
|
||||
widget.setVisible(self.showAdvanced)
|
||||
self.widgets[param.name] = widget
|
||||
else:
|
||||
label = QLabel(desc)
|
||||
label.setToolTip(tooltip)
|
||||
self.labels[param.name] = label
|
||||
if param.isAdvanced:
|
||||
label.setVisible(self.showAdvanced)
|
||||
widget.setVisible(self.showAdvanced)
|
||||
self.widgets[param.name] = widget
|
||||
self.verticalLayout.addWidget(label)
|
||||
|
||||
self.verticalLayout.addWidget(widget)
|
||||
|
||||
for output in self.alg.outputs:
|
||||
if output.hidden:
|
||||
continue
|
||||
label = QtGui.QLabel(output.description)
|
||||
label = QLabel(output.description)
|
||||
widget = OutputSelectionPanel(output, self.alg)
|
||||
self.verticalLayout.addWidget(label)
|
||||
self.verticalLayout.addWidget(widget)
|
||||
if isinstance(output, (OutputRaster, OutputVector, OutputTable)):
|
||||
check = QtGui.QCheckBox()
|
||||
check = QCheckBox()
|
||||
check.setText('Open output file after running algorithm')
|
||||
check.setChecked(True)
|
||||
self.verticalLayout.addWidget(check)
|
||||
@ -205,7 +217,7 @@ class ParametersPanel(QtGui.QWidget):
|
||||
item = InputLayerSelectorPanel(items, param)
|
||||
elif isinstance(param, ParameterVector):
|
||||
if self.somethingDependsOnThisParameter(param) or self.alg.allowOnlyOpenedLayers:
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
layers = dataobjects.getVectorLayers(param.shapetype)
|
||||
if param.optional:
|
||||
item.addItem(self.NOT_SELECTED, None)
|
||||
@ -227,7 +239,7 @@ class ParametersPanel(QtGui.QWidget):
|
||||
item = InputLayerSelectorPanel(items, param)
|
||||
elif isinstance(param, ParameterTable):
|
||||
if self.somethingDependsOnThisParameter(param):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
layers = dataobjects.getTables()
|
||||
if param.optional:
|
||||
item.addItem(self.NOT_SELECTED, None)
|
||||
@ -248,15 +260,13 @@ class ParametersPanel(QtGui.QWidget):
|
||||
items.insert(0, items.pop(i))
|
||||
item = InputLayerSelectorPanel(items, param)
|
||||
elif isinstance(param, ParameterBoolean):
|
||||
item = QtGui.QComboBox()
|
||||
item.addItem('Yes')
|
||||
item.addItem('No')
|
||||
item = QCheckBox()
|
||||
if param.default:
|
||||
item.setCurrentIndex(0)
|
||||
item.setChecked(True)
|
||||
else:
|
||||
item.setCurrentIndex(1)
|
||||
item.setChecked(False)
|
||||
elif isinstance(param, ParameterTableField):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
if param.parent in self.dependentItems:
|
||||
items = self.dependentItems[param.parent]
|
||||
else:
|
||||
@ -273,7 +283,7 @@ class ParametersPanel(QtGui.QWidget):
|
||||
item.addItem("[not set]")
|
||||
item.addItems(self.getFields(layers[0], param.datatype))
|
||||
elif isinstance(param, ParameterSelection):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.addItems(param.options)
|
||||
item.setCurrentIndex(param.default)
|
||||
elif isinstance(param, ParameterFixedTable):
|
||||
@ -305,25 +315,25 @@ class ParametersPanel(QtGui.QWidget):
|
||||
item = CrsSelectionPanel(param.default)
|
||||
elif isinstance(param, ParameterString):
|
||||
if param.multiline:
|
||||
verticalLayout = QtGui.QVBoxLayout()
|
||||
verticalLayout = QVBoxLayout()
|
||||
verticalLayout.setSizeConstraint(
|
||||
QtGui.QLayout.SetDefaultConstraint)
|
||||
textEdit = QtGui.QPlainTextEdit()
|
||||
QLayout.SetDefaultConstraint)
|
||||
textEdit = QPlainTextEdit()
|
||||
textEdit.setPlainText(param.default)
|
||||
verticalLayout.addWidget(textEdit)
|
||||
item = textEdit
|
||||
else:
|
||||
item = QtGui.QLineEdit()
|
||||
item = QLineEdit()
|
||||
item.setText(str(param.default))
|
||||
else:
|
||||
item = QtGui.QLineEdit()
|
||||
item = QLineEdit()
|
||||
item.setText(str(param.default))
|
||||
|
||||
return item
|
||||
|
||||
def updateDependentFields(self):
|
||||
sender = self.sender()
|
||||
if not isinstance(sender, QtGui.QComboBox):
|
||||
if not isinstance(sender, QComboBox):
|
||||
return
|
||||
if not sender.name in self.dependentItems:
|
||||
return
|
||||
@ -340,9 +350,9 @@ class ParametersPanel(QtGui.QWidget):
|
||||
def getFields(self, layer, datatype):
|
||||
fieldTypes = []
|
||||
if datatype == ParameterTableField.DATA_TYPE_STRING:
|
||||
fieldTypes = [QtCore.QVariant.String]
|
||||
fieldTypes = [QVariant.String]
|
||||
elif datatype == ParameterTableField.DATA_TYPE_NUMBER:
|
||||
fieldTypes = [QtCore.QVariant.Int, QtCore.QVariant.Double]
|
||||
fieldTypes = [QVariant.Int, QVariant.Double]
|
||||
|
||||
fieldNames = set()
|
||||
for field in layer.pendingFields():
|
||||
@ -365,8 +375,8 @@ class ParametersPanel(QtGui.QWidget):
|
||||
self.tableWidget.setRowCount(numParams + numOutputs)
|
||||
|
||||
for i, param in enumerate(params):
|
||||
item = QtGui.QTableWidgetItem(param.description)
|
||||
item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
item = QTableWidgetItem(param.description)
|
||||
item.setFlags(Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(i, 0, item)
|
||||
item = self.getWidgetFromParameter(param)
|
||||
self.valueItems[param.name] = item
|
||||
@ -374,9 +384,9 @@ class ParametersPanel(QtGui.QWidget):
|
||||
self.tableWidget.setRowHeight(i, 22)
|
||||
|
||||
for i, output in enumerate(outputs):
|
||||
item = QtGui.QTableWidgetItem(output.description + '<'
|
||||
item = QTableWidgetItem(output.description + '<'
|
||||
+ output.__module__.split('.')[-1] + '>')
|
||||
item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
item.setFlags(Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(i, 0, item)
|
||||
item = OutputSelectionPanel(output, self.alg)
|
||||
self.valueItems[output.name] = item
|
||||
|
@ -25,7 +25,9 @@ __copyright__ = '(C) 2012, Victor Olaya'
|
||||
|
||||
__revision__ = '$Format:%H$'
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
from processing.core.parameters import Parameter
|
||||
from processing.core.parameters import ParameterBoolean
|
||||
from processing.core.parameters import ParameterRaster
|
||||
@ -39,7 +41,7 @@ from processing.core.parameters import ParameterExtent
|
||||
from processing.core.parameters import ParameterFile
|
||||
|
||||
|
||||
class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
class ModelerParameterDefinitionDialog(QDialog):
|
||||
|
||||
PARAMETER_NUMBER = 'Number'
|
||||
PARAMETER_RASTER = 'Raster Layer'
|
||||
@ -71,30 +73,30 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
self.alg = alg
|
||||
self.paramType = paramType
|
||||
self.param = param
|
||||
QtGui.QDialog.__init__(self)
|
||||
QDialog.__init__(self)
|
||||
self.setModal(True)
|
||||
self.setupUi()
|
||||
|
||||
def setupUi(self):
|
||||
self.setWindowTitle('Parameter definition')
|
||||
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self)
|
||||
self.verticalLayout = QVBoxLayout(self)
|
||||
self.verticalLayout.setSpacing(40)
|
||||
self.verticalLayout.setMargin(20)
|
||||
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self)
|
||||
self.horizontalLayout = QHBoxLayout(self)
|
||||
self.horizontalLayout.setSpacing(2)
|
||||
self.horizontalLayout.setMargin(0)
|
||||
self.label = QtGui.QLabel('Parameter name')
|
||||
self.label = QLabel('Parameter name')
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.nameTextBox = QtGui.QLineEdit()
|
||||
self.nameTextBox = QLineEdit()
|
||||
self.horizontalLayout.addWidget(self.nameTextBox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
|
||||
self.horizontalLayout2 = QtGui.QHBoxLayout(self)
|
||||
self.horizontalLayout2 = QHBoxLayout(self)
|
||||
self.horizontalLayout2.setSpacing(2)
|
||||
self.horizontalLayout2.setMargin(0)
|
||||
self.horizontalLayout3 = QtGui.QHBoxLayout(self)
|
||||
self.horizontalLayout3 = QHBoxLayout(self)
|
||||
self.horizontalLayout3.setSpacing(2)
|
||||
self.horizontalLayout3.setMargin(0)
|
||||
|
||||
@ -104,19 +106,18 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
if self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_BOOLEAN \
|
||||
or isinstance(self.param, ParameterBoolean):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Default value'))
|
||||
self.yesNoCombo = QtGui.QComboBox()
|
||||
self.yesNoCombo.addItem('Yes')
|
||||
self.yesNoCombo.addItem('No')
|
||||
self.state = QCheckBox()
|
||||
self.state.setText('Checked')
|
||||
self.state.setChecked(False)
|
||||
if self.param is not None:
|
||||
self.yesNoCombo.setCurrentIndex((0 if self.param.value else 1))
|
||||
self.horizontalLayout2.addWidget(self.yesNoCombo)
|
||||
self.state.setChecked(True if self.param.value else False)
|
||||
self.horizontalLayout2.addWidget(self.state)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout2)
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_TABLE_FIELD \
|
||||
or isinstance(self.param, ParameterTableField):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Parent layer'))
|
||||
self.parentCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Parent layer'))
|
||||
self.parentCombo = QComboBox()
|
||||
idx = 0
|
||||
for param in self.alg.inputs.values():
|
||||
if isinstance(param.param, (ParameterVector, ParameterTable)):
|
||||
@ -130,8 +131,8 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_RASTER \
|
||||
or isinstance(self.param, ParameterRaster):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Required'))
|
||||
self.yesNoCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Required'))
|
||||
self.yesNoCombo = QComboBox()
|
||||
self.yesNoCombo.addItem('Yes')
|
||||
self.yesNoCombo.addItem('No')
|
||||
if self.param is not None:
|
||||
@ -142,8 +143,8 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_TABLE \
|
||||
or isinstance(self.param, ParameterTable):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Required'))
|
||||
self.yesNoCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Required'))
|
||||
self.yesNoCombo = QComboBox()
|
||||
self.yesNoCombo.addItem('Yes')
|
||||
self.yesNoCombo.addItem('No')
|
||||
if self.param is not None:
|
||||
@ -154,13 +155,13 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_VECTOR \
|
||||
or isinstance(self.param, ParameterVector):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Required'))
|
||||
self.yesNoCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Required'))
|
||||
self.yesNoCombo = QComboBox()
|
||||
self.yesNoCombo.addItem('Yes')
|
||||
self.yesNoCombo.addItem('No')
|
||||
self.horizontalLayout2.addWidget(self.yesNoCombo)
|
||||
self.horizontalLayout3.addWidget(QtGui.QLabel('Shape type'))
|
||||
self.shapetypeCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout3.addWidget(QLabel('Shape type'))
|
||||
self.shapetypeCombo = QComboBox()
|
||||
self.shapetypeCombo.addItem('Any')
|
||||
self.shapetypeCombo.addItem('Point')
|
||||
self.shapetypeCombo.addItem('Line')
|
||||
@ -176,13 +177,13 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_MULTIPLE \
|
||||
or isinstance(self.param, ParameterMultipleInput):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Mandatory'))
|
||||
self.yesNoCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Mandatory'))
|
||||
self.yesNoCombo = QComboBox()
|
||||
self.yesNoCombo.addItem('Yes')
|
||||
self.yesNoCombo.addItem('No')
|
||||
self.horizontalLayout2.addWidget(self.yesNoCombo)
|
||||
self.horizontalLayout3.addWidget(QtGui.QLabel('Data type'))
|
||||
self.datatypeCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout3.addWidget(QLabel('Data type'))
|
||||
self.datatypeCombo = QComboBox()
|
||||
self.datatypeCombo.addItem('Vector (any)')
|
||||
self.datatypeCombo.addItem('Vector (point)')
|
||||
self.datatypeCombo.addItem('Vector (line)')
|
||||
@ -199,14 +200,14 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_NUMBER \
|
||||
or isinstance(self.param, ParameterNumber):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Min/Max values'))
|
||||
self.minTextBox = QtGui.QLineEdit()
|
||||
self.maxTextBox = QtGui.QLineEdit()
|
||||
self.horizontalLayout2.addWidget(QLabel('Min/Max values'))
|
||||
self.minTextBox = QLineEdit()
|
||||
self.maxTextBox = QLineEdit()
|
||||
self.horizontalLayout2.addWidget(self.minTextBox)
|
||||
self.horizontalLayout2.addWidget(self.maxTextBox)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout2)
|
||||
self.horizontalLayout3.addWidget(QtGui.QLabel('Default value'))
|
||||
self.defaultTextBox = QtGui.QLineEdit()
|
||||
self.horizontalLayout3.addWidget(QLabel('Default value'))
|
||||
self.defaultTextBox = QLineEdit()
|
||||
self.defaultTextBox.setText('0')
|
||||
if self.param is not None:
|
||||
self.defaultTextBox.setText(str(self.param.default))
|
||||
@ -215,8 +216,8 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_STRING \
|
||||
or isinstance(self.param, ParameterString):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Default value'))
|
||||
self.defaultTextBox = QtGui.QLineEdit()
|
||||
self.horizontalLayout2.addWidget(QLabel('Default value'))
|
||||
self.defaultTextBox = QLineEdit()
|
||||
if self.param is not None:
|
||||
self.defaultTextBox.setText(self.param.default)
|
||||
self.horizontalLayout2.addWidget(self.defaultTextBox)
|
||||
@ -224,8 +225,8 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
elif self.paramType == \
|
||||
ModelerParameterDefinitionDialog.PARAMETER_FILE \
|
||||
or isinstance(self.param, ParameterFile):
|
||||
self.horizontalLayout2.addWidget(QtGui.QLabel('Type'))
|
||||
self.fileFolderCombo = QtGui.QComboBox()
|
||||
self.horizontalLayout2.addWidget(QLabel('Type'))
|
||||
self.fileFolderCombo = QComboBox()
|
||||
self.fileFolderCombo.addItem('File')
|
||||
self.fileFolderCombo.addItem('Folder')
|
||||
if self.param is not None:
|
||||
@ -234,15 +235,13 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
self.horizontalLayout2.addWidget(self.fileFolderCombo)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout2)
|
||||
|
||||
self.buttonBox = QtGui.QDialogButtonBox(self)
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
|
||||
| QtGui.QDialogButtonBox.Ok)
|
||||
self.buttonBox = QDialogButtonBox(self)
|
||||
self.buttonBox.setOrientation(Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
|
||||
| QDialogButtonBox.Ok)
|
||||
self.buttonBox.setObjectName('buttonBox')
|
||||
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL('accepted()'),
|
||||
self.okPressed)
|
||||
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL('rejected()'),
|
||||
self.cancelPressed)
|
||||
self.buttonBox.accepted.connect(self.okPressed)
|
||||
self.buttonBox.rejected.connect(self.cancelPressed)
|
||||
|
||||
self.verticalLayout.addWidget(self.buttonBox)
|
||||
|
||||
@ -251,7 +250,7 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
def okPressed(self):
|
||||
description = unicode(self.nameTextBox.text())
|
||||
if description.strip() == '':
|
||||
QtGui.QMessageBox.warning(self, 'Unable to define parameter',
|
||||
QMessageBox.warning(self, 'Unable to define parameter',
|
||||
'Invalid parameter name')
|
||||
return
|
||||
if self.param is None:
|
||||
@ -266,12 +265,12 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_BOOLEAN \
|
||||
or isinstance(self.param, ParameterBoolean):
|
||||
self.param = ParameterBoolean(name, description,
|
||||
self.yesNoCombo.currentIndex() == 0)
|
||||
self.state.isChecked())
|
||||
elif self.paramType \
|
||||
== ModelerParameterDefinitionDialog.PARAMETER_TABLE_FIELD \
|
||||
or isinstance(self.param, ParameterTableField):
|
||||
if self.parentCombo.currentIndex() < 0:
|
||||
QtGui.QMessageBox.warning(self, 'Unable to define parameter',
|
||||
QMessageBox.warning(self, 'Unable to define parameter',
|
||||
'Wrong or missing parameter values')
|
||||
return
|
||||
parent = self.parentCombo.itemData(self.parentCombo.currentIndex())
|
||||
@ -315,7 +314,7 @@ class ModelerParameterDefinitionDialog(QtGui.QDialog):
|
||||
self.param = ParameterNumber(name, description, vmin, vmax,
|
||||
float(str(self.defaultTextBox.text())))
|
||||
except:
|
||||
QtGui.QMessageBox.warning(self, 'Unable to define parameter',
|
||||
QMessageBox.warning(self, 'Unable to define parameter',
|
||||
'Wrong or missing parameter values')
|
||||
return
|
||||
elif self.paramType \
|
||||
|
@ -27,7 +27,8 @@ __revision__ = '$Format:%H$'
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||
from PyQt4.QtWebKit import *
|
||||
|
||||
from processing.modeler.ModelerAlgorithm import ValueFromInput,\
|
||||
ValueFromOutput, Algorithm, ModelerOutput
|
||||
from processing.gui.CrsSelectionPanel import CrsSelectionPanel
|
||||
@ -39,14 +40,14 @@ from processing.core.parameters import *
|
||||
from processing.core.outputs import *
|
||||
|
||||
|
||||
class ModelerParametersDialog(QtGui.QDialog):
|
||||
class ModelerParametersDialog(QDialog):
|
||||
|
||||
ENTER_NAME = '[Enter name if this is a final result]'
|
||||
NOT_SELECTED = '[Not selected]'
|
||||
USE_MIN_COVERING_EXTENT = '[Use min covering extent]'
|
||||
|
||||
def __init__(self, alg, model, algName=None):
|
||||
QtGui.QDialog.__init__(self)
|
||||
QDialog.__init__(self)
|
||||
self.setModal(True)
|
||||
#The algorithm to define in this dialog. It is an instance of GeoAlgorithm
|
||||
self._alg = alg
|
||||
@ -67,39 +68,38 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
self.valueItems = {}
|
||||
self.dependentItems = {}
|
||||
self.resize(650, 450)
|
||||
self.buttonBox = QtGui.QDialogButtonBox()
|
||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel
|
||||
| QtGui.QDialogButtonBox.Ok)
|
||||
self.buttonBox = QDialogButtonBox()
|
||||
self.buttonBox.setOrientation(Qt.Horizontal)
|
||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
|
||||
| QDialogButtonBox.Ok)
|
||||
tooltips = self._alg.getParameterDescriptions()
|
||||
self.setSizePolicy(QtGui.QSizePolicy.Expanding,
|
||||
QtGui.QSizePolicy.Expanding)
|
||||
self.verticalLayout = QtGui.QVBoxLayout()
|
||||
self.setSizePolicy(QSizePolicy.Expanding,
|
||||
QSizePolicy.Expanding)
|
||||
self.verticalLayout = QVBoxLayout()
|
||||
self.verticalLayout.setSpacing(5)
|
||||
self.verticalLayout.setMargin(20)
|
||||
|
||||
hLayout = QtGui.QHBoxLayout()
|
||||
hLayout = QHBoxLayout()
|
||||
hLayout.setSpacing(5)
|
||||
hLayout.setMargin(0)
|
||||
descriptionLabel = QtGui.QLabel("Description")
|
||||
self.descriptionBox = QtGui.QLineEdit()
|
||||
descriptionLabel = QLabel("Description")
|
||||
self.descriptionBox = QLineEdit()
|
||||
self.descriptionBox.setText(self._alg.name)
|
||||
hLayout.addWidget(descriptionLabel)
|
||||
hLayout.addWidget(self.descriptionBox)
|
||||
self.verticalLayout.addLayout(hLayout)
|
||||
line = QtGui.QFrame()
|
||||
line.setFrameShape(QtGui.QFrame.HLine)
|
||||
line.setFrameShadow(QtGui.QFrame.Sunken)
|
||||
line = QFrame()
|
||||
line.setFrameShape(QFrame.HLine)
|
||||
line.setFrameShadow(QFrame.Sunken)
|
||||
self.verticalLayout.addWidget(line)
|
||||
|
||||
for param in self._alg.parameters:
|
||||
if param.isAdvanced:
|
||||
self.advancedButton = QtGui.QPushButton()
|
||||
self.advancedButton = QPushButton()
|
||||
self.advancedButton.setText('Show advanced parameters')
|
||||
self.advancedButton.setMaximumWidth(150)
|
||||
QtCore.QObject.connect(self.advancedButton,
|
||||
QtCore.SIGNAL('clicked()'),
|
||||
self.showAdvancedParametersClicked)
|
||||
self.advancedButton.clicked.connect(
|
||||
self.showAdvancedParametersClicked)
|
||||
self.verticalLayout.addWidget(self.advancedButton)
|
||||
break
|
||||
for param in self._alg.parameters:
|
||||
@ -108,7 +108,7 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
desc = param.description
|
||||
if isinstance(param, ParameterExtent):
|
||||
desc += '(xmin, xmax, ymin, ymax)'
|
||||
label = QtGui.QLabel(desc)
|
||||
label = QLabel(desc)
|
||||
self.labels[param.name] = label
|
||||
widget = self.getWidgetFromParameter(param)
|
||||
self.valueItems[param.name] = widget
|
||||
@ -130,7 +130,7 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
continue
|
||||
if isinstance(output, (OutputRaster, OutputVector, OutputTable,
|
||||
OutputHTML, OutputFile, OutputDirectory)):
|
||||
label = QtGui.QLabel(output.description + '<'
|
||||
label = QLabel(output.description + '<'
|
||||
+ output.__module__.split('.')[-1] + '>')
|
||||
item = QLineEdit()
|
||||
if hasattr(item, 'setPlaceholderText'):
|
||||
@ -139,9 +139,9 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
self.verticalLayout.addWidget(item)
|
||||
self.valueItems[output.name] = item
|
||||
|
||||
label = QtGui.QLabel(' ')
|
||||
label = QLabel(' ')
|
||||
self.verticalLayout.addWidget(label)
|
||||
label = QtGui.QLabel('Parent algorithms')
|
||||
label = QLabel('Parent algorithms')
|
||||
self.dependenciesPanel = self.getDependenciesPanel()
|
||||
self.verticalLayout.addWidget(label)
|
||||
self.verticalLayout.addWidget(self.dependenciesPanel)
|
||||
@ -151,18 +151,18 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
|
||||
self.setPreviousValues()
|
||||
self.setWindowTitle(self._alg.name)
|
||||
self.verticalLayout2 = QtGui.QVBoxLayout()
|
||||
self.verticalLayout2 = QVBoxLayout()
|
||||
self.verticalLayout2.setSpacing(2)
|
||||
self.verticalLayout2.setMargin(0)
|
||||
self.tabWidget = QtGui.QTabWidget()
|
||||
self.tabWidget = QTabWidget()
|
||||
self.tabWidget.setMinimumWidth(300)
|
||||
self.paramPanel = QtGui.QWidget()
|
||||
self.paramPanel = QWidget()
|
||||
self.paramPanel.setLayout(self.verticalLayout)
|
||||
self.scrollArea = QtGui.QScrollArea()
|
||||
self.scrollArea = QScrollArea()
|
||||
self.scrollArea.setWidget(self.paramPanel)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.tabWidget.addTab(self.scrollArea, 'Parameters')
|
||||
self.webView = QtWebKit.QWebView()
|
||||
self.webView = QWebView()
|
||||
|
||||
html = None
|
||||
url = None
|
||||
@ -171,7 +171,7 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
if isText:
|
||||
html = help;
|
||||
else:
|
||||
url = QtCore.QUrl(help)
|
||||
url = QUrl(help)
|
||||
else:
|
||||
html = '<h2>Sorry, no help is available for this \
|
||||
algorithm.</h2>'
|
||||
@ -186,11 +186,9 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
self.verticalLayout2.addWidget(self.tabWidget)
|
||||
self.verticalLayout2.addWidget(self.buttonBox)
|
||||
self.setLayout(self.verticalLayout2)
|
||||
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL('accepted()'),
|
||||
self.okPressed)
|
||||
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL('rejected()'),
|
||||
self.cancelPressed)
|
||||
QtCore.QMetaObject.connectSlotsByName(self)
|
||||
self.buttonBox.accepted.connect(self.okPressed)
|
||||
self.buttonBox.rejected.connect(self.cancelPressed)
|
||||
QMetaObject.connectSlotsByName(self)
|
||||
|
||||
def getAvailableDependencies(self):
|
||||
if self._algName is None:
|
||||
@ -248,21 +246,21 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
|
||||
def getWidgetFromParameter(self, param):
|
||||
if isinstance(param, ParameterRaster):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
layers = self.getAvailableValuesOfType(ParameterRaster, OutputRaster)
|
||||
if param.optional:
|
||||
item.addItem(self.NOT_SELECTED, None)
|
||||
for layer in layers:
|
||||
item.addItem(self.resolveValueDescription(layer), layer)
|
||||
elif isinstance(param, ParameterVector):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
layers = self.getAvailableValuesOfType(ParameterVector, OutputVector)
|
||||
if param.optional:
|
||||
item.addItem(self.NOT_SELECTED, None)
|
||||
for layer in layers:
|
||||
item.addItem(self.resolveValueDescription(layer), layer)
|
||||
elif isinstance(param, ParameterTable):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
layers = self.getAvailableValuesOfType(ParameterTable, OutputTable)
|
||||
if param.optional:
|
||||
@ -270,14 +268,12 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
for layer in layers:
|
||||
item.addItem(self.resolveValueDescription(layer), layer)
|
||||
elif isinstance(param, ParameterBoolean):
|
||||
item = QtGui.QComboBox()
|
||||
item.addItem('Yes')
|
||||
item.addItem('No')
|
||||
item = QComboBox()
|
||||
bools = self.getAvailableValuesOfType(ParameterBoolean, None)
|
||||
for b in bools:
|
||||
item.addItem(self.resolveValueDescription(b), b)
|
||||
elif isinstance(param, ParameterSelection):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.addItems(param.options)
|
||||
elif isinstance(param, ParameterFixedTable):
|
||||
item = FixedTablePanel(param)
|
||||
@ -299,19 +295,19 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
item = MultilineTextPanel(options)
|
||||
item.setText(unicode(param.default))
|
||||
else:
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
for desc, val in options:
|
||||
item.addItem(desc, val)
|
||||
item.setEditText(unicode(param.default))
|
||||
elif isinstance(param, ParameterTableField):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
fields = self.getAvailableValuesOfType(ParameterTableField, None)
|
||||
for f in fields:
|
||||
item.addItem(self.resolveValueDescription(f), f)
|
||||
elif isinstance(param, ParameterNumber):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
numbers = self.getAvailableValuesOfType(ParameterNumber, OutputNumber)
|
||||
for n in numbers:
|
||||
@ -320,7 +316,7 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
elif isinstance(param, ParameterCrs):
|
||||
item = CrsSelectionPanel(param.default)
|
||||
elif isinstance(param, ParameterExtent):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
extents = self.getAvailableValuesOfType(ParameterExtent, OutputExtent)
|
||||
if self.canUseAutoExtent():
|
||||
@ -330,13 +326,13 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
if not self.canUseAutoExtent():
|
||||
item.setEditText(str(param.default))
|
||||
elif isinstance(param, ParameterFile):
|
||||
item = QtGui.QComboBox()
|
||||
item = QComboBox()
|
||||
item.setEditable(True)
|
||||
files = self.getAvailableValuesOfType(ParameterFile, OutputFile)
|
||||
for f in files:
|
||||
item.addItem(self.resolveValueDescription(f), f)
|
||||
else:
|
||||
item = QtGui.QLineEdit()
|
||||
item = QLineEdit()
|
||||
try:
|
||||
item.setText(str(param.default))
|
||||
except:
|
||||
@ -357,8 +353,8 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
self.tableWidget.setRowCount(len(visibleParams) + len(visibleOutputs))
|
||||
|
||||
for i, param in visibleParams:
|
||||
item = QtGui.QTableWidgetItem(param.description)
|
||||
item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
item = QTableWidgetItem(param.description)
|
||||
item.setFlags(Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(i, 0, item)
|
||||
item = self.getWidgetFromParameter(param)
|
||||
self.valueItems[param.name] = item
|
||||
@ -366,9 +362,9 @@ class ModelerParametersDialog(QtGui.QDialog):
|
||||
self.tableWidget.setRowHeight(i, 22)
|
||||
|
||||
for i, output in visibleOutputs:
|
||||
item = QtGui.QTableWidgetItem(output.description + '<'
|
||||
item = QTableWidgetItem(output.description + '<'
|
||||
+ output.__module__.split('.')[-1] + '>')
|
||||
item.setFlags(QtCore.Qt.ItemIsEnabled)
|
||||
item.setFlags(Qt.ItemIsEnabled)
|
||||
self.tableWidget.setItem(i, 0, item)
|
||||
item = QLineEdit()
|
||||
if hasattr(item, 'setPlaceholderText'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user