Allowing all QGIS workspace layers to be editable at once











up vote
4
down vote

favorite












I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question









New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    7 hours ago












  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    4 hours ago















up vote
4
down vote

favorite












I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question









New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    7 hours ago












  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    4 hours ago













up vote
4
down vote

favorite









up vote
4
down vote

favorite











I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem










share|improve this question









New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I stumbled upon an odd behaviour of layers in QGIS 3.4 brought from PostGIS. The first layers I brought to the project are always editable together when clicking the Toggle Edit-button, but some of the other layers are editable only when separately selected. These layers have been brought to the project afterwards. I have tested this in 3.4.0 and 3.4.2. with Windows (as QGS and QGZ). Also when the same project was used by others in their own environment, all the layers had to be separately changed to editable. This causes problems because there are relations between the tables and you have to know what tables should be editable. How can I make all the layers editable at once?



Edit: Noticed that when the same layers are brought to a new project, they have to be clicked editable one at a time. I have used Project Generator tool to create the layers and some of the relations between the layers.



Here an example of the problem







qgis layers editing






share|improve this question









New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 hours ago









Andy

872314




872314






New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 7 hours ago









Sanna Jokela

214




214




New contributor




Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Sanna Jokela is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    7 hours ago












  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    4 hours ago














  • 1




    Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
    – Jochen Schwarze
    7 hours ago












  • Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
    – Sanna Jokela
    4 hours ago








1




1




Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
– Jochen Schwarze
7 hours ago






Welcome to GIS.SE! Are the layers brought afterwards from the same PostGIS DB? If so, did you try to check Automatically create transaction groups where possible under Project > Project Properties > Data Sources ?
– Jochen Schwarze
7 hours ago














Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
– Sanna Jokela
4 hours ago




Yes, the layers are from the same database but the first ones were brought with QGIS Project Generator tool (that also brought the relations) the other layers were brought afterwards through normal add layer method. The transaction groups is by default checked. The most bizarre thing is that the same project (qgs) behaves differently in other setup with our client. But we'll have to check if they have that button checked.
– Sanna Jokela
4 hours ago










2 Answers
2






active

oldest

votes

















up vote
4
down vote













What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer



















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    3 hours ago


















up vote
3
down vote













There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer





















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    3 hours ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Sanna Jokela is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f305804%2fallowing-all-qgis-workspace-layers-to-be-editable-at-once%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
4
down vote













What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer



















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    3 hours ago















up vote
4
down vote













What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer



















  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    3 hours ago













up vote
4
down vote










up vote
4
down vote









What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()





share|improve this answer














What @jochen-schwarze suggested, should work but if needed, you can put all vector layers that have been opened in the project to edit mode with the following code in QGIS 3:



layers = QgsProject.instance().mapLayers()
for layer in layers.values():
if isinstance(layer, QgsVectorLayer) and not layer.isEditable():
layer.startEditing()






share|improve this answer














share|improve this answer



share|improve this answer








edited 2 hours ago

























answered 3 hours ago









Orienteerix

348211




348211








  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    3 hours ago














  • 1




    Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
    – Sanna Jokela
    3 hours ago








1




1




Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
– Sanna Jokela
3 hours ago




Thank you @orienteerix :) I think we have a workaround for this now. But still a bit baffled how to get some of the layers to the transactiongroup suggested by Jochen. But we can do this now! Thank you all!
– Sanna Jokela
3 hours ago












up vote
3
down vote













There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer





















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    3 hours ago















up vote
3
down vote













There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer





















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    3 hours ago













up vote
3
down vote










up vote
3
down vote









There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.






share|improve this answer












There is a chunk of code here - Set layer in edit mode in QGIS processing that may help. You can either put that in the Plugins/Python Counsel (Ctrl+Alt+P) or possibly write a small plugin with a button that launches this.



Click on the little "Show Editor" button paste your code and save it. Then run it with the green run button.



enter image description here



I am not sure if there is a plug-in for that specifically but you could look at the Digitizing Tools Plug-in and see if you can select more than one layer and set those to Edit.







share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









Cary Hutchinson

587




587












  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    3 hours ago


















  • Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
    – Sanna Jokela
    3 hours ago
















Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
– Sanna Jokela
3 hours ago




Thank you @caryhutchinson, we shall see if there is some help on this and report here (I have not used Python console my self, but my colleague can help)!
– Sanna Jokela
3 hours ago










Sanna Jokela is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Sanna Jokela is a new contributor. Be nice, and check out our Code of Conduct.













Sanna Jokela is a new contributor. Be nice, and check out our Code of Conduct.












Sanna Jokela is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f305804%2fallowing-all-qgis-workspace-layers-to-be-editable-at-once%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What visual should I use to simply compare current year value vs last year in Power BI desktop

Alexandru Averescu

Trompette piccolo