Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iface.addvectorlayer doesn't work in processing script #27919

Closed
qgib opened this issue Oct 12, 2018 · 1 comment
Closed

iface.addvectorlayer doesn't work in processing script #27919

qgib opened this issue Oct 12, 2018 · 1 comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Oct 12, 2018

Author Name: Vincent Dionne (Vincent Dionne)
Original Redmine Issue: 20097
Affected QGIS version: 3.2.2
Redmine category:processing/core


Hello,

if you try to load a layer within a processing script using : layer = iface.addVectorLayer("path2asimpleshapefile.shp","test", "ogr").

The layer will not be added on the canvas. But the layer object will be OK.

NB: I noticed that it is working if you remove all parameter from the script !?! But it will not work if you add any parameter ( QgsProcessingParameterVectorLayer for example)

It was working fine in 2.18.

thank you,

@qgib
Copy link
Contributor Author

qgib commented Oct 12, 2018

Author Name: Nyall Dawson (@nyalldawson)


This isnt thread safe, so not possible in 3.x. use context.addLayerToLoadOnCompletion instead


  • resolution was changed from to wontfix
  • status_id was changed from Open to Rejected

@qgib qgib closed this as completed Oct 12, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant