void QgsAtlasCompositionWidget::on_mApplyConfigButton_clicked()
{
  QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
  if ( !atlasMap )
  {
    return;
  }

  QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( mAtlasCoverageLayerComboBox->currentLayer() );
  if ( !vl )
  {
    atlasMap->setCoverageLayer( 0 );
  }
  else
  {
    atlasMap->setCoverageLayer( vl );
  }

  atlasMap->setSortFeatures( mAtlasSortFeatureCheckBox->isChecked() );
  atlasMap->setSortKeyAttributeName( mAtlasSortFeatureKeyComboBox->currentField() );
  Qt::ArrowType at = mAtlasSortFeatureDirectionButton->arrowType();
  at = ( at == Qt::UpArrow ) ? Qt::DownArrow : Qt::UpArrow;
  atlasMap->setSortAscending( at == Qt::UpArrow );
  atlasMap->setFilterFeatures( mAtlasFeatureFilterCheckBox->isChecked() );
  atlasMap->setFeatureFilter( mAtlasFeatureFilterEdit->text() );
  atlasMap->setPageNameExpression( mPageNameWidget->currentField() );
  atlasMap->setHideCoverage( mAtlasHideCoverageCheckBox->isChecked() );

  updateAtlasFeatures();
}
Ejemplo n.º 2
0
void QgsAtlasCompositionWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int state )
{
  QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
  if ( !atlasMap )
  {
    return;
  }
  atlasMap->setHideCoverage( state == Qt::Checked );
}