def opendefaultexpression(self): layer = self.form.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultvalueText.text().strip('[%').strip('%]').strip() dlg.setExpressionText(text) if dlg.exec_(): self.defaultvalueText.setText('[% {} %]'.format(dlg.expressionText()))
def opendefaultexpression(self): layer = self.currentform.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultvalueText.text().strip('[%').strip('%]').strip() dlg.setExpressionText(text) if dlg.exec_(): self.defaultvalueText.setText('[% {} %]'.format(dlg.expressionText()))
def add_expression_condition(self): dlg = QgsExpressionBuilderDialog(self.layer, "Set condition expression", self) text = self.condtionText.text() dlg.setExpressionText(text) if dlg.exec_(): self.condtionText.setText(dlg.expressionText())
def add_expression_newvalue(self): dlg = QgsExpressionBuilderDialog(self.layer, "Set expression for new value", self) text = self.newValueText.text() dlg.setExpressionText(text) if dlg.exec_(): self.newValueText.setText(dlg.expressionText())
def opendefaultexpression(self): """ Open the default expression builder for setting default values based on QGIS Expressions. """ layer = self.form.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultvalueText.text().strip('[%').strip('%]').strip() dlg.setExpressionText(text) if dlg.exec_(): self.defaultvalueText.setText('[% {} %]'.format(dlg.expressionText()))
def opendefaultexpression_advanced(self): """ Open the default expression builder for setting advanced default values based on QGIS Expressions. """ layer = self.form.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultValueExpression.text() dlg.setExpressionText(text) if dlg.exec_(): self.defaultValueExpression.setText(dlg.expressionText())
def define_filter(self): layer = self.layerCombo.currentText() if not layer: return layer = layer_by_name(layer) dlg = QgsExpressionBuilderDialog(layer, "List filter", self) text = self.filterText.toPlainText() dlg.setExpressionText(text) if dlg.exec_(): self.filterText.setPlainText(dlg.expressionText())
def define_filter(self): layer = self.layerCombo.currentText() if not layer: return layer = layer_by_name(layer) dlg = QgsExpressionBuilderDialog(layer, "List filter", self) text = self.filterText.toPlainText() dlg.setExpressionText(text) if dlg.exec_(): self.filterText.setPlainText(dlg.expressionText())
def opendefaultexpression(self): """ Open the default expression builder for setting default values based on QGIS Expressions. """ layer = self.form.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultvalueText.text().strip('[%').strip('%]').strip() dlg.setExpressionText(text) if dlg.exec_(): self.defaultvalueText.setText('[% {} %]'.format(dlg.expressionText()))
def opendefaultexpression_advanced(self): """ Open the default expression builder for setting advanced default values based on QGIS Expressions. """ layer = self.form.QGISLayer dlg = QgsExpressionBuilderDialog(layer, "Create default value expression", self) text = self.defaultValueExpression.text() dlg.setExpressionText(text) if dlg.exec_(): self.defaultValueExpression.setText(dlg.expressionText())
def buildHighlight(self): dialog = QgsExpressionBuilderDialog(self.collection().layer('lines')) dialog.setExpressionText(self.collection().highlight) if (dialog.exec_()): self.applyHighlight(dialog.expressionText())
def buildSelection(self): dialog = QgsExpressionBuilderDialog(self.collection().layer('lines')) dialog.setExpressionText(self.collection().selection) if (dialog.exec_()): self.applySelection(dialog.expressionText())
def add_expression_newvalue(self): dlg = QgsExpressionBuilderDialog(self.layer, "Set expression for new value", self) text = self.newValueText.text() dlg.setExpressionText(text) if dlg.exec_(): self.newValueText.setText(dlg.expressionText())
def add_expression_condition(self): dlg = QgsExpressionBuilderDialog(self.layer, "Set condition expression", self) text = self.condtionText.text() dlg.setExpressionText(text) if dlg.exec_(): self.condtionText.setText(dlg.expressionText())