Hi this may be more of a python question rather than qgis processing script question. I've managed to successfully get the output that I want from my processing script, but I wish to take one step further and style it automatically with a saved qml file.

The code below doesn't work because the return ends my script. How should I go about doing this?

return {self.OUTPUT: dest_id}
  • Are you trying to set the style after the processing tool (from Python) or are you trying to set the style from within the processing tool itself? – etrimaille Aug 31 '19 at 9:48

Have you tried using an absolute path?

return {self.OUTPUT: dest_id}
# example: iface.activeLayer().loadNamedStyle(u"D:\\qml_files\\Buffer.qml")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.