Skip to content

Commit

Permalink
Add changed signal to QgsXyzSourceWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 27, 2023
1 parent e8cec91 commit 94cf996
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/gui/auto_generated/qgsprovidersourcewidget.sip.in
Expand Up @@ -63,6 +63,13 @@ Emitted whenever the validation status of the widget changes.

If ``isValid`` is ``False`` then the widget is not valid, and any dialog using the widget should be prevented from
being accepted.
%End

void changed();
%Docstring
Emitted whenever the configuration of the widget changes.

.. versionadded:: 3.30
%End

};
Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgsprovidersourcewidget.h
Expand Up @@ -78,6 +78,13 @@ class GUI_EXPORT QgsProviderSourceWidget : public QWidget
*/
void validChanged( bool isValid );

/**
* Emitted whenever the configuration of the widget changes.
*
* \since QGIS 3.30
*/
void changed();

private:
QgsMapCanvas *mMapCanvas = nullptr;

Expand Down
14 changes: 14 additions & 0 deletions src/providers/wms/qgsxyzsourcewidget.cpp
Expand Up @@ -32,8 +32,22 @@ QgsXyzSourceWidget::QgsXyzSourceWidget( QWidget *parent )
mSpinZMax->setClearValue( 18 );

connect( mEditUrl, &QLineEdit::textChanged, this, &QgsXyzSourceWidget::validate );
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsProviderSourceWidget::changed );

connect( mCheckBoxZMin, &QCheckBox::toggled, this, &QgsProviderSourceWidget::changed );
connect( mSpinZMin, qOverload< int >( &QSpinBox::valueChanged ), this, &QgsProviderSourceWidget::changed );
connect( mCheckBoxZMax, &QCheckBox::toggled, this, &QgsProviderSourceWidget::changed );
connect( mSpinZMax, qOverload< int >( &QSpinBox::valueChanged ), this, &QgsProviderSourceWidget::changed );
connect( mAuthSettings, &QgsAuthSettingsWidget::configIdChanged, this, &QgsProviderSourceWidget::changed );
connect( mAuthSettings, &QgsAuthSettingsWidget::usernameChanged, this, &QgsProviderSourceWidget::changed );
connect( mAuthSettings, &QgsAuthSettingsWidget::passwordChanged, this, &QgsProviderSourceWidget::changed );
connect( mEditReferer, &QLineEdit::textChanged, this, &QgsProviderSourceWidget::changed );
connect( mComboTileResolution, qOverload< int >( &QComboBox::currentIndexChanged ), this, &QgsProviderSourceWidget::changed );

mInterpretationCombo = new QgsWmsInterpretationComboBox( this );
mInterpretationLayout->addWidget( mInterpretationCombo );

connect( mInterpretationCombo, qOverload< int >( &QComboBox::currentIndexChanged ), this, &QgsProviderSourceWidget::changed );
}

void QgsXyzSourceWidget::setSourceUri( const QString &uri )
Expand Down

0 comments on commit 94cf996

Please sign in to comment.