QGIS/python/PyQt6/gui/auto_generated/qgsnewnamedialog.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

192 lines
5.8 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsnewnamedialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsNewNameDialog : QgsDialog
{
%Docstring(signature="appended")
A dialog for prompting users for a new name, for example new layer name
dialog.
If existing names are provided, the dialog warns users if an entered
name already exists.
%End
%TypeHeaderCode
#include "qgsnewnamedialog.h"
%End
public:
QgsNewNameDialog( const QString &source = QString(), const QString &initial = QString(), const QStringList &extensions = QStringList(), const QStringList &existing = QStringList(), Qt::CaseSensitivity cs = Qt::CaseSensitive, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
%Docstring
New dialog constructor.
:param source: original data source name, e.g. original layer name of
the layer to be copied
:param initial: initial name
:param extensions: base name extensions, e.g. raster base name band
extensions or vector layer type extensions
:param existing: existing names
:param cs: case sensitivity for new name to existing names comparison
:param parent: parent widget
:param flags: window flags
.. note::
Earlier versions had a similar constructor but with extra arguments for ``regexp`` which were removed in QGIS 3.22 as they relied on the deprecated QRegExp class. Use :py:func:`~QgsNewNameDialog.setRegularExpression` instead.
.. versionadded:: 3.22
%End
void setHintString( const QString &hintString );
%Docstring
Sets the hint string for the dialog (the text shown above the name input
box).
:param hintString: hint text
.. seealso:: :py:func:`hintString`
%End
QString hintString() const;
%Docstring
Returns the hint string for the dialog (the text shown above the name
input box).
.. seealso:: :py:func:`setHintString`
%End
void setOverwriteEnabled( bool enabled );
%Docstring
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.
.. seealso:: :py:func:`overwriteEnabled`
%End
bool overwriteEnabled() const;
%Docstring
Returns whether users are permitted to overwrite existing names.
.. seealso:: :py:func:`setOverwriteEnabled`
.. seealso:: :py:func:`setShowExistingNamesCompleter`
%End
void setAllowEmptyName( bool allowed );
%Docstring
Sets whether users are permitted to leave the widget empty. If ``True``,
the dialog will accept an empty name value.
.. seealso:: :py:func:`allowEmptyName`
.. versionadded:: 3.14
%End
bool allowEmptyName() const;
%Docstring
Returns ``True`` if the widget can be left empty (no name filled).
.. seealso:: :py:func:`setAllowEmptyName`
.. versionadded:: 3.14
%End
void setConflictingNameWarning( const QString &string );
%Docstring
Sets the string used for warning users if a conflicting name exists.
:param string: warning string. If empty a default warning string will be
used.
.. seealso:: :py:func:`conflictingNameWarning`
%End
QString conflictingNameWarning() const;
%Docstring
Returns the string used for warning users if a conflicting name exists.
.. seealso:: :py:func:`setConflictingNameWarning`
%End
void setRegularExpression( const QString &expression );
%Docstring
Sets a regular ``expression`` to use for validating user-entered names
in the dialog.
.. versionadded:: 3.22
%End
void setShowExistingNamesCompleter( bool show );
%Docstring
Sets whether a completer for existing names should be used in the line
edit.
This is not shown by default. If the dialog is expected to be used in a
context where overwriting is permitted, consider enabling this so that
users can more easily enter an existing name.
.. seealso:: :py:func:`overwriteEnabled`
.. versionadded:: 3.44
%End
QString name() const;
%Docstring
Name entered by user.
:return: new name
.. seealso:: :py:func:`newNameChanged`
%End
static bool exists( const QString &name, const QStringList &extensions, const QStringList &existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
%Docstring
Test if name or name with at least one extension exists.
:param name: name or base name
:param extensions: base name extensions
:param existing: existing names
:param cs: case sensitivity for new name to existing names comparison
:return: ``True`` if name exists
%End
signals:
void newNameChanged();
%Docstring
Emitted when the name is changed in the dialog.
.. versionadded:: 3.2
%End
public slots:
void nameChanged();
protected:
QString highlightText( const QString &text );
%Docstring
List of names with extensions
%End
static QStringList fullNames( const QString &name, const QStringList &extensions );
static QStringList matching( const QStringList &newNames, const QStringList &existingNames, Qt::CaseSensitivity cs = Qt::CaseSensitive );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsnewnamedialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/