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();
}
예제 #2
0
void QgsAtlasCompositionWidget::on_mAtlasFeatureFilterCheckBox_stateChanged( int state )
{
  QgsAtlasComposition* atlasMap = &mComposition->atlasComposition();
  if ( !atlasMap )
  {
    return;
  }

  if ( state == Qt::Checked )
  {
    mAtlasFeatureFilterEdit->setEnabled( true );
    mAtlasFeatureFilterButton->setEnabled( true );
  }
  else
  {
    mAtlasFeatureFilterEdit->setEnabled( false );
    mAtlasFeatureFilterButton->setEnabled( false );
  }
  atlasMap->setFilterFeatures( state == Qt::Checked );
  updateAtlasFeatures();
}