File: qgsnewnamedialog.sip.in

package info (click to toggle)
qgis 3.40.10%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,183,672 kB
  • sloc: cpp: 1,595,771; python: 372,544; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 161
file content (172 lines) | stat: -rw-r--r-- 5,404 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/************************************************************************
 * 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")
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`
%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

    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   *
 ************************************************************************/