本文整理汇总了Python中qgis.PyQt.QtWidgets.QDialog.accept方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.accept方法的具体用法?Python QDialog.accept怎么用?Python QDialog.accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtWidgets.QDialog
的用法示例。
在下文中一共展示了QDialog.accept方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
styles = {}
for key in list(self.valueItems.keys()):
styles[key] = str(self.valueItems[key].getValue())
RenderingStyles.addAlgStylesAndSave(self.alg.id(), styles)
QDialog.accept(self)
示例2: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
#QMessageBox.warning(self.iface.mainWindow(), "VoGIS-Profiltool", "ACCEPTED")
QgsMessageLog.logMessage("accept: {0}".format(self.exaggeration_edited), "VoGis", Qgis.Info)
if self.exaggeration_edited is True:
self.exaggeration_edited = False
return
QDialog.accept(self)
示例3: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
styles = {}
for key in self.valueItems.keys():
styles[key] = unicode(self.valueItems[key].getValue())
RenderingStyles.addAlgStylesAndSave(self.alg.commandLineName(), styles)
QDialog.accept(self)
示例4: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
layer = self.get_current_layer()
label = self.autoLabelCheckBox.isChecked()
layerout = self.layerNameLine.text()
self.UnitsComboBox.setCurrentIndex(self.UnitsComboBox.findData(layer.crs().mapUnits()))
distance = self.distanceSpinBox.value()
startpoint = self.startSpinBox.value()
endpoint = self.endSpinBox.value()
selected_only = self.selectOnlyRadioBtn.isChecked()
force = self.forceLastCheckBox.isChecked()
fo_fila = self.force_fl_CB.isChecked()
divide = self.divideSpinBox.value()
decimal = self.decimalSpinBox.value()
projection_setting_key = "Projections/defaultBehaviour"
old_projection_setting = self.qgisSettings.value(projection_setting_key)
self.qgisSettings.setValue(projection_setting_key, "useGlobal")
self.qgisSettings.sync()
points_along_line(
layerout,
startpoint,
endpoint,
distance,
label,
layer,
selected_only,
force,
fo_fila,
divide,
decimal)
self.qgisSettings.setValue(projection_setting_key, old_projection_setting)
QDialog.accept(self)
示例5: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
self.selectedoptions = []
model = self.lstLayers.model()
for i in range(model.rowCount()):
item = model.item(i)
self.selectedoptions.append(item.text())
QDialog.accept(self)
示例6: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
self.selectedoptions = []
model = self.lstLayers.model()
for i in range(model.rowCount()):
item = model.item(i)
if item.checkState() == Qt.Checked:
self.selectedoptions.append(item.data(Qt.UserRole))
QDialog.accept(self)
示例7: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
try:
self.value = float(eval(str(self.leFormula.text())))
if self.isInteger:
self.value = int(round(self.value))
QDialog.accept(self)
except:
QMessageBox.critical(self, self.tr('Wrong expression'),
self.tr('The expression entered is not correct'))
示例8: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
cols = self.tblView.model().columnCount()
rows = self.tblView.model().rowCount()
# Table MUST BE 1-dimensional to match core QgsProcessingParameterMatrix expectations
self.rettable = []
for row in range(rows):
for col in range(cols):
self.rettable.append(str(self.tblView.model().item(row, col).text()))
QDialog.accept(self)
示例9: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
settings = QgsSettings()
settings.setValue("/pstimeseries/titleProps", self.titleFontProps())
settings.setValue("/pstimeseries/labelsProps", self.labelsFontProps())
settings.setValue("/pstimeseries/pointsProps", self.pointsProps())
settings.setValue("/pstimeseries/pointsReplicasProps", self.pointsReplicasProps())
settings.setValue("/pstimeseries/linesProps", self.linesProps())
settings.setValue("/pstimeseries/linesThrendProps", self.linesThrendProps())
QDialog.accept(self)
示例10: confirm
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def confirm(self):
# runs when OK button is pressed
# initialise input parameters
self.BASE_LAYER = self.dlg.ui.comboBase.currentItemData()
self.SECONDARY_LAYER = self.dlg.ui.comboSecondary.currentItemData()
self.SURFACE_LAYER = self.dlg.ui.comboSurface.currentItemData()
self.LOCALITIES_LAYER = self.dlg.ui.comboLocalities.currentItemData()
self.TAXON_FIELD_INDEX = self.dlg.ui.comboTaxonField.currentItemData()[0]
self.GRID_LAYER = self.dlg.ui.comboGrid.currentItemData()
self.X_MIN = float(self.dlg.ui.leMinX.text())
self.Y_MIN = float(self.dlg.ui.leMinY.text())
self.X_MAX = float(self.dlg.ui.leMaxX.text())
self.Y_MAX = float(self.dlg.ui.leMaxY.text())
self.OUT_WIDTH = self.dlg.ui.spnOutWidth.value()
self.OUT_HEIGHT = self.dlg.ui.spnOutHeight.value()
self.OUT_DIR = self.dlg.ui.leOutDir.text()
try:
self.getUniqueValues()
except:
message = "Could not get unique values from localities layer. "
message += "Check that the localities layer and taxon identifier "
message += "field are properly specified."
QMessageBox.information(self.dlg,"Distribution Map Generator",
message)
return
question = "This will generate " + str(self.UNIQUE_COUNT)
question += " maps. Are you sure you want to continue?"
reply = QMessageBox.question(self.dlg,'Distribution Map Generator',
question,
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
self.GRID_INDEX = QgsSpatialIndex()
for feat in getLayerFromId(self.GRID_LAYER).getFeatures():
self.GRID_INDEX.insertFeature(feat)
if reply == QMessageBox.Yes:
try:
self.process()
except QgsCsException:
return
except Exception as ex:
log(ex)
return
QMessageBox.information(self.dlg,"Distribution Map Generator",
"Map processing complete.")
self.dlg.ui.progressBar.setValue(0)
QDialog.accept(self.dlg)
else:
return
示例11: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
if not self.preloadAPI.isChecked() and \
not self.groupBoxPreparedAPI.isChecked():
if self.tableWidget.rowCount() == 0:
QMessageBox.information(self, self.tr("Warning!"),
self.tr('Please specify API file or check "Use preloaded API files"'))
return
if self.groupBoxPreparedAPI.isChecked() and \
not self.lineEdit.text():
QMessageBox.information(self, self.tr("Warning!"),
self.tr('The APIs file was not compiled, click on "Compile APIs..."'))
return
self.saveSettings()
self.listPath = []
QDialog.accept(self)
示例12: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
"""add CSW entry"""
conn_name = self.leName.text().strip()
conn_url = self.leURL.text().strip()
conn_username = self.leUsername.text().strip()
conn_password = self.lePassword.text().strip()
if any([conn_name == '', conn_url == '']):
QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Both Name and URL must be provided.'))
return
if '/' in conn_name:
QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Name cannot contain \'/\'.'))
return
if conn_name is not None:
key = '/MetaSearch/%s' % conn_name
keyurl = '%s/url' % key
key_orig = '/MetaSearch/%s' % self.conn_name_orig
# warn if entry was renamed to an existing connection
if all([self.conn_name_orig != conn_name,
self.settings.contains(keyurl)]):
res = QMessageBox.warning(self, self.tr('Save Connection'),
self.tr('Overwrite {0}?').format(conn_name),
QMessageBox.Ok | QMessageBox.Cancel)
if res == QMessageBox.Cancel:
return
# on rename delete original entry first
if all([self.conn_name_orig is not None,
self.conn_name_orig != conn_name]):
self.settings.remove(key_orig)
self.settings.setValue(keyurl, conn_url)
self.settings.setValue('/MetaSearch/selected', conn_name)
if conn_username != '':
self.settings.setValue('%s/username' % key, conn_username)
if conn_password != '':
self.settings.setValue('%s/password' % key, conn_password)
QDialog.accept(self)
示例13: on_buttonBox_accepted
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def on_buttonBox_accepted(self):
settings = QSettings("PostNAS", "PostNAS-Suche")
settings.setValue("host", self.leHOST.text())
settings.setValue("port", self.lePORT.text())
settings.setValue("dbname", self.leDBNAME.text())
settings.setValue("user", self.leUID.text())
settings.setValue("password", self.lePWD.text())
if hasattr(qgis.gui,'QgsAuthConfigSelect'):
settings.setValue( "authcfg", self.authCfgSelect.configId() )
if(self.checkBox.checkState() == Qt.Checked):
settings.setValue("accessControl",1)
else:
settings.setValue("accessControl",0)
QDialog.accept(self)
示例14: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
# Set our connection preference based on the combo-box
s = QSettings()
if self.postgisConnectionComboBox.count() > 0:
connecionName = self.postgisConnectionComboBox.currentText()
s.setValue("constraintchecker/postgisConnection", connecionName)
try:
self.saveConfiguration()
except:
msg = 'An error occurred when trying to save the configuration. ' \
'The details are:\n\n%s' % traceback.format_exc()
QMessageBox.critical(self, 'Error Saving Configuration', msg)
return
QDialog.accept(self)
示例15: accept
# 需要导入模块: from qgis.PyQt.QtWidgets import QDialog [as 别名]
# 或者: from qgis.PyQt.QtWidgets.QDialog import accept [as 别名]
def accept(self):
projects = self.ui.projectsFolderLineEdit.text()
self.settings.setValue("SelectorTools/ProjectSelector/projectRoot", projects)
templates = self.ui.templateRootLineEdit.text()
self.settings.setValue("SelectorTools/TemplateSelector/templateRoot", templates)
try:
with open(DEFAULTS, 'w') as paths:
paths.write('projects:{}\n'.format(projects))
paths.write('templates:{}\n'.format(templates))
except IOError:
QMessageBox.warning(None, \
'Could not save folders', \
'%s could not be opened for writing, please ensure you have permission to edit this file.' \
% DEFAULTS )
project_selector_enabled = self.ui.projectSelectorEnabledCheckBox.isChecked()
self.settings.setValue("SelectorTools/ProjectSelector/isEnabled", project_selector_enabled)
identifiable_only = self.ui.identifiableOnly.isChecked()
self.settings.setValue("SelectorTools/ProjectSelector/identifiableOnly", identifiable_only)
QDialog.accept(self)