1

In pyqgis 2 standalone application, the following code will trigger the display of vertex as red cross mark, but in pyqgis 3.0.3 standalone application, it doesn't:

layer.startEditing()
mapCanvas.refresh()

why is that? Do we have to somehow manually trigger the vertex markers to be displayed?

1 Answer 1

2

Your code works fine, the likely issue is that there is a default setting which only shows vertices when editing selected features. You can check this by going to:

Settings > Options > Digitizing > Vertex markers

Digitizing settings

Uncheck this and run your code again, the vertices should now show up for all features.

4
  • this looks promising, just that this is a standalone pyqgis 3 application, how to unset this setting through a function call? Aug 23, 2018 at 14:37
  • 1
    @ForComment - Maybe try something like: from PyQt5.QtCore import QSettings; QSettings().setValue("/Qgis/digitizing/marker_only_for_selected", False). This works from the console but can't confirm for a standalone application.
    – Joseph
    Aug 23, 2018 at 14:43
  • 1
    Yes, the QSetting code worked. Just need to do this at the top of the module, then it displays all vertices' markers Aug 23, 2018 at 15:36
  • @ForComment - Nice one! Glad it helped :)
    – Joseph
    Aug 24, 2018 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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