Class: QgsNewVectorLayerDialog¶
-
class
qgis.gui.
QgsNewVectorLayerDialog
(parent: QWidget = None, fl: Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)¶ Bases:
PyQt5.QtWidgets.QDialog
New dialog constructor.
Enums
Methods
Appends the chosen attribute names and types to at
Returns the selected CRS for the new layer.
Runs the dialog and creates a layer matching the dialog parameters.
Returns the name for the new layer
Runs the dialog and creates a layer matching the dialog parameters.
Returns the file format for storage
Returns the file format for storage
Returns the selected geometry type
Sets the
crs
value for the new layer in the dialog.Sets the initial file name to show in the dialog.
Signals
Attributes
-
actionEvent
()¶
-
attributes
(self, at: Iterable[Tuple[str, str]])¶ Appends the chosen attribute names and types to at
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
crs
(self) → QgsCoordinateReferenceSystem¶ Returns the selected CRS for the new layer.
See also
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
eventFilter
()¶
-
execAndCreateLayer
(parent: QWidget = None, initialPath: str = '', crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem()) → Tuple[str, str, str]¶ Runs the dialog and creates a layer matching the dialog parameters.
If the
initialPath
argument is specified, then the dialog will default to the specified filename.Returns a filename if the dialog was accepted, or an empty string if the dialog was canceled. If the dialog was accepted but an error occurred while creating the file, then the function will return an empty string and
errorMessage
will contain the error message.If
encoding
is specified, it will be set to the encoding of the created file.- Parameters
parent – parent widget for dialog
initialPath – initial file path to show in dialog
encoding – if specified, will be set to file encoding of created layer
crs – default layer CRS to show in dialog
- Returns
Newly created file name, or an empty string if user canceled or an error occurred.
errorMessage: will be set to any error message encountered during layer creation
New in version 3.4.5.
-
filename
(self) → str¶ Returns the name for the new layer
See also
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
runAndCreateLayer
(parent: QWidget = None, enc: str = '', crs: QgsCoordinateReferenceSystem = QgsCoordinateReferenceSystem(), initialPath: str = '') → str¶ Runs the dialog and creates a layer matching the dialog parameters.
If the
initialPath
argument is specified, then the dialog will default to the specified filename.- Returns
fileName on success, empty string use aborted, QString() if creation failed
Deprecated since version in: QGIS 3.4.5 - use execAndCreateLayer() instead.
-
selectedFileEncoding
(self) → str¶ Returns the file format for storage
-
selectedFileFormat
(self) → str¶ Returns the file format for storage
-
selectedType
(self) → QgsWkbTypes.Type¶ Returns the selected geometry type
-
sender
()¶
-
senderSignalIndex
()¶
-
setCrs
(self, crs: QgsCoordinateReferenceSystem)¶ Sets the
crs
value for the new layer in the dialog.See also
New in version 3.0.
-
setFilename
(self, filename: str)¶ Sets the initial file name to show in the dialog.
See also
New in version 3.6.
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-