mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-03 00:14:12 -05:00 
			
		
		
		
	reverting 3fb0f66 (followup #45348) Using --no-public-is-protected (default on Windows) also works on Linux and fixes #45331 too
		
			
				
	
	
		
			188 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			188 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/gui/qgsnewnamedialog.h                                           *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
class QgsNewNameDialog : QgsDialog
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
New name, for example new layer name dialog. If existing names are provided,
 | 
						|
the dialog warns users if an entered name already exists.
 | 
						|
 | 
						|
.. versionadded:: 2.10
 | 
						|
%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`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%End
 | 
						|
 | 
						|
    QString hintString() const;
 | 
						|
%Docstring
 | 
						|
Returns the hint string for the dialog (the text shown above the name
 | 
						|
input box).
 | 
						|
 | 
						|
.. seealso:: :py:func:`setHintString`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%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`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%End
 | 
						|
 | 
						|
    bool overwriteEnabled() const;
 | 
						|
%Docstring
 | 
						|
Returns whether users are permitted to overwrite existing names.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setOverwriteEnabled`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%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`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%End
 | 
						|
 | 
						|
    QString conflictingNameWarning() const;
 | 
						|
%Docstring
 | 
						|
Returns the string used for warning users if a conflicting name exists.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setConflictingNameWarning`
 | 
						|
 | 
						|
.. versionadded:: 2.12
 | 
						|
%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
 | 
						|
 | 
						|
    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.pl again   *
 | 
						|
 ************************************************************************/
 |