Skip to content

Commit 2f5ef8e

Browse files
committed
Fix regression - lost "load from raster band" button in raster GUI
1 parent 805e7ec commit 2f5ef8e

3 files changed

+2
-14
lines changed

src/gui/raster/qgscolorrampshaderwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ void QgsColorRampShaderWidget::initializeForUseWithRasterLayer()
9797
{
9898
Q_ASSERT( mClassificationModeComboBox->findData( QgsColorRampShader::Quantile < 0 ) );
9999
mClassificationModeComboBox->addItem( tr( "Quantile" ), QgsColorRampShader::Quantile );
100-
mLoadFromBandButton->setVisible( bool( mRasterDataProvider ) ); // only for raster version
101100
}
102101

103102
void QgsColorRampShaderWidget::setRasterDataProvider( QgsRasterDataProvider *dp )
104103
{
105104
mRasterDataProvider = dp;
105+
mLoadFromBandButton->setVisible( bool( mRasterDataProvider ) ); // only for raster version
106106
}
107107

108108
void QgsColorRampShaderWidget::setRasterBand( int band )

src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp

+1-12
Original file line numberDiff line numberDiff line change
@@ -143,25 +143,14 @@ void QgsSingleBandPseudoColorRendererWidget::setMapCanvas( QgsMapCanvas *canvas
143143
mColorRampShaderWidget->setExtent( mMinMaxWidget->extent() );
144144
}
145145

146-
void QgsSingleBandPseudoColorRendererWidget::mLoadFromBandButton_clicked()
147-
{
148-
if ( !mRasterLayer || !mRasterLayer->dataProvider() )
149-
{
150-
return;
151-
}
152-
153-
int bandIndex = mBandComboBox->currentBand();
154-
mColorRampShaderWidget->setRasterBand( bandIndex );
155-
emit widgetChanged();
156-
}
157-
158146
void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRenderer *r )
159147
{
160148
const QgsSingleBandPseudoColorRenderer *pr = dynamic_cast<const QgsSingleBandPseudoColorRenderer *>( r );
161149
if ( pr )
162150
{
163151
mBandComboBox->setBand( pr->band() );
164152
mMinMaxWidget->setBands( QList< int >() << pr->band() );
153+
mColorRampShaderWidget->setRasterBand( pr->band() );
165154

166155
const QgsRasterShader *rasterShader = pr->shader();
167156
if ( rasterShader )

src/gui/raster/qgssinglebandpseudocolorrendererwidget.h

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere
6666
void loadMinMaxFromTree( double min, double max );
6767

6868
private slots:
69-
void mLoadFromBandButton_clicked();
7069
void bandChanged();
7170
void mMinLineEdit_textChanged( const QString & );
7271
void mMaxLineEdit_textChanged( const QString & );

0 commit comments

Comments
 (0)