26 , mDisableMinMaxWidgetRefresh( false )
29 connect( mMinLineEdit, &QLineEdit::textChanged,
this, &QgsSingleBandGrayRendererWidget::mMinLineEdit_textChanged );
30 connect( mMaxLineEdit, &QLineEdit::textChanged,
this, &QgsSingleBandGrayRendererWidget::mMaxLineEdit_textChanged );
35 mMinLineEdit->setValidator(
new QDoubleValidator( mMinLineEdit ) );
36 mMaxLineEdit->setValidator(
new QDoubleValidator( mMaxLineEdit ) );
50 QHBoxLayout *layout =
new QHBoxLayout();
51 layout->setContentsMargins( 0, 0, 0, 0 );
52 mMinMaxContainerWidget->setLayout( layout );
53 layout->addWidget( mMinMaxWidget );
88 int band = mGrayBandComboBox->currentBand();
97 renderer->setContrastEnhancement( e );
116 void QgsSingleBandGrayRendererWidget::mMinLineEdit_textChanged(
const QString & )
121 void QgsSingleBandGrayRendererWidget::mMaxLineEdit_textChanged(
const QString & )
126 void QgsSingleBandGrayRendererWidget::minMaxModified()
128 if ( !mDisableMinMaxWidgetRefresh )
132 mContrastEnhancementComboBox->setCurrentIndex(
145 QgsDebugMsg( QStringLiteral(
"theBandNo = %1 min = %2 max = %3" ).arg( bandNo ).arg(
min ).arg(
max ) );
147 mDisableMinMaxWidgetRefresh =
true;
148 if ( std::isnan(
min ) )
150 mMinLineEdit->clear();
154 mMinLineEdit->setText( QString::number(
min ) );
157 if ( std::isnan(
max ) )
159 mMaxLineEdit->clear();
163 mMaxLineEdit->setText( QString::number(
max ) );
165 mDisableMinMaxWidgetRefresh =
false;
168 void QgsSingleBandGrayRendererWidget::bandChanged()
171 myBands.append( mGrayBandComboBox->currentBand() );
182 mGrayBandComboBox->setBand( gr->
grayBand() );
184 mGradientComboBox->setCurrentIndex( mGradientComboBox->findData( gr->
gradient() ) );
190 mDisableMinMaxWidgetRefresh =
true;
191 mMinLineEdit->setText( QString::number( ce->
minimumValue() ) );
192 mMaxLineEdit->setText( QString::number( ce->
maximumValue() ) );
193 mDisableMinMaxWidgetRefresh =
false;
195 mContrastEnhancementComboBox->setCurrentIndex(
205 mDisableMinMaxWidgetRefresh =
true;
206 mMinLineEdit->setText( value );
207 mDisableMinMaxWidgetRefresh =
false;
212 mDisableMinMaxWidgetRefresh =
true;
213 mMaxLineEdit->setText( value );
214 mDisableMinMaxWidgetRefresh =
false;