Class: QgsNewNameDialog¶
-
class
qgis.gui.
QgsNewNameDialog
(source: str = '', initial: str = '', extensions: Iterable[str] = [], existing: Iterable[str] = [], regexp: QRegExp = QRegExp(), cs: Qt.CaseSensitivity = Qt.CaseSensitive, parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)¶ Bases:
qgis._gui.QgsDialog
New dialog constructor.
- Parameters
source – original data source name, e.g. original layer name of the layer to be copied
initial – initial name
extensions – base name extensions, e.g. raster base name band extensions or vector layer type extensions
existing – existing names
regexp – regular expression to be used as validator, for example db tables should have “[A-Za-z_][A-Za-z0-9_]+”
cs – case sensitivity for new name to existing names comparison
parent –
flags –
New name, for example new layer name dialog. If existing names are provided, the dialog warns users if an entered name already exists.
New in version 2.10: Enums
Methods
Returns the string used for warning users if a conflicting name exists.
Test if name or name with at least one extension exists.
List of names with extensions
Returns the hint string for the dialog (the text shown above the name input box).
Name entered by user.
Returns whether users are permitted to overwrite existing names.
Sets the string used for warning users if a conflicting name exists.
Sets the hint string for the dialog (the text shown above the name input box).
Sets whether users are permitted to overwrite existing names.
Signals
Emitted when the name is changed in the dialog.
Attributes
-
actionEvent
()¶
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
conflictingNameWarning
(self) → str¶ Returns the string used for warning users if a conflicting name exists.
See also
New in version 2.12.
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
eventFilter
()¶
-
exists
(name: str, extensions: Iterable[str], existing: Iterable[str], cs: Qt.CaseSensitivity = Qt.CaseSensitive) → bool¶ Test if name or name with at least one extension exists.
- Parameters
name – name or base name
extensions – base name extensions
existing – existing names
cs – case sensitivity for new name to existing names comparison
- Returns
true if name exists
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
fullNames
(name: str, extensions: Iterable[str]) → List[str]¶
-
hideEvent
()¶
-
highlightText
(self, text: str) → str¶ List of names with extensions
-
hintString
(self) → str¶ Returns the hint string for the dialog (the text shown above the name input box).
See also
New in version 2.12.
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
()¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
matching
(newNames: Iterable[str], existingNames: Iterable[str], cs: Qt.CaseSensitivity = Qt.CaseSensitive) → List[str]¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
()¶
-
mouseReleaseEvent
()¶
-
moveEvent
()¶
-
name
(self) → str¶ Name entered by user.
- Returns
new name
See also
-
nameChanged
(self)¶
-
nativeEvent
()¶
-
newNameChanged
¶ Emitted when the name is changed in the dialog.
New in version 3.2: [signal]
-
overwriteEnabled
(self) → bool¶ Returns whether users are permitted to overwrite existing names.
See also
New in version 2.12.
-
paintEvent
()¶
-
receivers
()¶
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setConflictingNameWarning
(self, string: str)¶ Sets the string used for warning users if a conflicting name exists.
- Parameters
string – warning string. If empty a default warning string will be used.
See also
New in version 2.12.
-
setHintString
(self, hintString: str)¶ Sets the hint string for the dialog (the text shown above the name input box).
- Parameters
hintString – hint text
See also
New in version 2.12.
-
setOverwriteEnabled
(self, enabled: bool)¶ Sets whether users are permitted to overwrite existing names. If true, then the dialog will reflect that the new name will overwrite an existing name. If false, then the dialog will not accept names which already exist.
See also
New in version 2.12.
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶