def editIconPathAction(self): if self.infoBoxIni["infoLayer"] in self.layerSet.keys(): self.QEX = gui.QgsExpressionBuilderDialog( self.layerSet[self.infoBoxIni["infoLayer"]], "Insert expression", None) self.QEX.setExpressionText( self.iconPath.text().strip('[%').strip('%]').strip()) if self.QEX.exec_(): self.iconPath.setText('[% {} %]'.format( self.QEX.expressionText()))
def editInfoBoxHtmlAction(self): if self.infoBoxIni["infoLayer"] in self.layerSet.keys(): self.QEX = gui.QgsExpressionBuilderDialog( self.layerSet[self.infoBoxIni["infoLayer"]], "Insert expression", None) self.QEX.setExpressionText( self.infoboxHtml.textCursor().selectedText().strip('[%').strip( '%]').strip()) if self.QEX.exec_(): self.infoboxHtml.insertPlainText('[% {} %]'.format( self.QEX.expressionText()))