Ejemplo n.º 1
0
void QgsZonalStatisticsDialog::on_mRasterLayerComboBox_currentIndexChanged( int index )
{
  Q_UNUSED( index );

  QgsRasterLayer* layer = rasterLayer();
  if ( !layer )
  {
    mBandComboBox->setEnabled( false );
    return;
  }

  mBandComboBox->setEnabled( true );
  mBandComboBox->clear();

  int bandCountInt = layer->bandCount();
  for ( int i = 1; i <= bandCountInt; ++i )
  {
    mBandComboBox->addItem( layer->bandName( i ) );
  }
}