I'm using the following code that displays a window to create a new Shapefile:
from qgis.gui import QgsNewVectorLayerDialog
new_vector_layer_dialog = QgsNewVectorLayerDialog()
new_vector_layer_dialog.show()
How can I put a flag on the Polygon by code, and not the line or the point?
Also when you press the OK
button, how to get the dialog to select where to save the Shapefile?
When you click OK
, it does not create a Shapefile, but just closes the dialog box. Additionally, it does not create a vector layer in the Layers Panel
.
What do I need to do to create the layer and load it into the Layers Panel
?