Skip to content
Permalink
Browse files

Add a newNameChanged signal to QgsNewNameDialog

Handy for subclasses.
  • Loading branch information
nyalldawson committed May 14, 2018
1 parent 773e863 commit 8d5e5c944dfa8e2fcbece765ab03e75145956605
Showing with 25 additions and 0 deletions.
  1. +12 −0 python/gui/qgsnewnamedialog.sip.in
  2. +1 −0 src/gui/qgsnewnamedialog.cpp
  3. +12 −0 src/gui/qgsnewnamedialog.h
@@ -107,6 +107,8 @@ Returns the string used for warning users if a conflicting name exists.
Name entered by user.

:return: new name

.. seealso:: :py:func:`newNameChanged`
%End

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

: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();

@@ -59,6 +59,7 @@ QgsNewNameDialog::QgsNewNameDialog( const QString &source, const QString &initia
}
mLineEdit->setMinimumWidth( mLineEdit->fontMetrics().width( QStringLiteral( "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ) ) );
connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::nameChanged );
connect( mLineEdit, &QLineEdit::textChanged, this, &QgsNewNameDialog::newNameChanged );
layout()->addWidget( mLineEdit );

mNamesLabel = new QLabel( QStringLiteral( " " ), this );
@@ -101,6 +101,7 @@ class GUI_EXPORT QgsNewNameDialog : public QgsDialog
/**
* Name entered by user.
* \returns new name
* \see newNameChanged()
*/
QString name() const;

@@ -114,7 +115,18 @@ class GUI_EXPORT QgsNewNameDialog : public QgsDialog
*/
static bool exists( const QString &name, const QStringList &extensions,
const QStringList &existing, Qt::CaseSensitivity cs = Qt::CaseSensitive );
signals:

// TODO QGIS 4.0 - rename to nameChanged

/**
* Emitted when the name is changed in the dialog.
* \since QGIS 3.2
*/
void newNameChanged();

public slots:
// TODO QGIS 4.0 - rename to onNameChanged
void nameChanged();

protected:

0 comments on commit 8d5e5c9

Please sign in to comment.
You can’t perform that action at this time.