本文整理汇总了Python中sextante.core.SextanteConfig.SextanteConfig.saveSettings方法的典型用法代码示例。如果您正苦于以下问题:Python SextanteConfig.saveSettings方法的具体用法?Python SextanteConfig.saveSettings怎么用?Python SextanteConfig.saveSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sextante.core.SextanteConfig.SextanteConfig
的用法示例。
在下文中一共展示了SextanteConfig.saveSettings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: okPressed
# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import saveSettings [as 别名]
def okPressed(self):
for setting in self.items.keys():
if isinstance(setting.value,bool):
setting.value = (self.items[setting].checkState(1) == QtCore.Qt.Checked)
elif isinstance(setting.value, (float,int, long)):
value = str(self.items[setting].text(1))
try:
value = float(value)
setting.value = value
except ValueError:
QtGui.QMessageBox.critical(self, "Wrong value","Wrong parameter value:\n" + value)
return
else:
setting.value = str(self.items[setting].text(1))
SextanteConfig.addSetting(setting)
SextanteConfig.saveSettings()
self.toolbox.updateTree()
self.close()
示例2: accept
# 需要导入模块: from sextante.core.SextanteConfig import SextanteConfig [as 别名]
# 或者: from sextante.core.SextanteConfig.SextanteConfig import saveSettings [as 别名]
def accept(self):
for setting in self.items.keys():
if isinstance(setting.value,bool):
setting.value = (self.items[setting].checkState(1) == Qt.Checked)
elif isinstance(setting.value, (float,int, long)):
value = str(self.items[setting].text(1))
try:
value = float(value)
setting.value = value
except ValueError:
QMessageBox.critical(self,
self.tr("Wrong value"),
self.tr("Wrong parameter value:\n%1").arg(value)
)
return
else:
setting.value = str(self.items[setting].text(1))
SextanteConfig.addSetting(setting)
SextanteConfig.saveSettings()
self.toolbox.updateTree()
QDialog.accept(self)