Skip to content

Commit 2d0810c

Browse files
committedMay 14, 2018
Add a newNameChanged signal to QgsNewNameDialog
Handy for subclasses. (cherry-picked from 8d5e5c9)
1 parent 83a8d01 commit 2d0810c

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
 

‎python/gui/qgsnewnamedialog.sip.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ Returns the string used for warning users if a conflicting name exists.
107107
Name entered by user.
108108

109109
:return: new name
110+
111+
.. seealso:: :py:func:`newNameChanged`
110112
%End
111113

112114
static bool exists( const QString &name, const QStringList &extensions,
@@ -121,6 +123,16 @@ Test if name or name with at least one extension exists.
121123

122124
:return: true if name exists
123125
%End
126+
signals:
127+
128+
129+
void newNameChanged();
130+
%Docstring
131+
Emitted when the name is changed in the dialog.
132+
133+
.. versionadded:: 3.2
134+
%End
135+
124136
public slots:
125137
void nameChanged();
126138

‎src/gui/qgsnewnamedialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ QgsNewNameDialog::QgsNewNameDialog( const QString &source, const QString &initia
5959
}
6060
mLineEdit->setMinimumWidth( mLineEdit->fontMetrics().width( QStringLiteral( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) ) );
6161
connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::nameChanged );
62+
connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::newNameChanged );
6263
layout()->addWidget( mLineEdit );
6364

6465
mNamesLabel = new QLabel( QStringLiteral( " " ), this );

‎src/gui/qgsnewnamedialog.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class GUI_EXPORT QgsNewNameDialog : public QgsDialog
101101
/**
102102
* Name entered by user.
103103
* \returns new name
104+
* \see newNameChanged()
104105
*/
105106
QString name() const;
106107

@@ -114,7 +115,18 @@ class GUI_EXPORT QgsNewNameDialog : public QgsDialog
114115
*/
115116
static bool exists( const QString &name, const QStringList &extensions,
116117
const QStringList &existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
118+
signals:
119+
120+
// TODO QGIS 4.0 - rename to nameChanged
121+
122+
/**
123+
* Emitted when the name is changed in the dialog.
124+
* \since QGIS 3.2
125+
*/
126+
void newNameChanged();
127+
117128
public slots:
129+
// TODO QGIS 4.0 - rename to onNameChanged
118130
void nameChanged();
119131

120132
protected:

0 commit comments

Comments
 (0)
Please sign in to comment.