mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-04 00:30:59 -05:00
parent
e643e7f6ab
commit
c7e7baaaa8
@ -91,6 +91,9 @@ void QgsLayoutAtlasWidget::mUseAtlasCheckBox_stateChanged( int state )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::changeCoverageLayer( QgsMapLayer *layer )
|
void QgsLayoutAtlasWidget::changeCoverageLayer( QgsMapLayer *layer )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer );
|
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer );
|
||||||
|
|
||||||
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Layer" ) );
|
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Layer" ) );
|
||||||
@ -109,6 +112,9 @@ void QgsLayoutAtlasWidget::changeCoverageLayer( QgsMapLayer *layer )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasFilenamePatternEdit_editingFinished()
|
void QgsLayoutAtlasWidget::mAtlasFilenamePatternEdit_editingFinished()
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
QString error;
|
QString error;
|
||||||
mBlockUpdates = true;
|
mBlockUpdates = true;
|
||||||
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Filename" ) );
|
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Filename" ) );
|
||||||
@ -126,7 +132,7 @@ void QgsLayoutAtlasWidget::mAtlasFilenamePatternEdit_editingFinished()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasFilenameExpressionButton_clicked()
|
void QgsLayoutAtlasWidget::mAtlasFilenameExpressionButton_clicked()
|
||||||
{
|
{
|
||||||
if ( !mAtlas || !mAtlas->coverageLayer() )
|
if ( !mLayout || !mAtlas || !mAtlas->coverageLayer() )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -160,6 +166,9 @@ void QgsLayoutAtlasWidget::mAtlasFilenameExpressionButton_clicked()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasHideCoverageCheckBox_stateChanged( int state )
|
void QgsLayoutAtlasWidget::mAtlasHideCoverageCheckBox_stateChanged( int state )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
mBlockUpdates = true;
|
mBlockUpdates = true;
|
||||||
mLayout->undoStack()->beginCommand( mAtlas, tr( "Toggle Atlas Layer" ) );
|
mLayout->undoStack()->beginCommand( mAtlas, tr( "Toggle Atlas Layer" ) );
|
||||||
mAtlas->setHideCoverage( state == Qt::Checked );
|
mAtlas->setHideCoverage( state == Qt::Checked );
|
||||||
@ -169,6 +178,9 @@ void QgsLayoutAtlasWidget::mAtlasHideCoverageCheckBox_stateChanged( int state )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasSingleFileCheckBox_stateChanged( int state )
|
void QgsLayoutAtlasWidget::mAtlasSingleFileCheckBox_stateChanged( int state )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( state == Qt::Checked )
|
if ( state == Qt::Checked )
|
||||||
{
|
{
|
||||||
mAtlasFilenamePatternEdit->setEnabled( false );
|
mAtlasFilenamePatternEdit->setEnabled( false );
|
||||||
@ -185,6 +197,9 @@ void QgsLayoutAtlasWidget::mAtlasSingleFileCheckBox_stateChanged( int state )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasSortFeatureCheckBox_stateChanged( int state )
|
void QgsLayoutAtlasWidget::mAtlasSortFeatureCheckBox_stateChanged( int state )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( state == Qt::Checked )
|
if ( state == Qt::Checked )
|
||||||
{
|
{
|
||||||
mAtlasSortFeatureDirectionButton->setEnabled( true );
|
mAtlasSortFeatureDirectionButton->setEnabled( true );
|
||||||
@ -205,6 +220,9 @@ void QgsLayoutAtlasWidget::mAtlasSortFeatureCheckBox_stateChanged( int state )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::changesSortFeatureExpression( const QString &expression, bool )
|
void QgsLayoutAtlasWidget::changesSortFeatureExpression( const QString &expression, bool )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
mBlockUpdates = true;
|
mBlockUpdates = true;
|
||||||
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Sort" ) );
|
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Sort" ) );
|
||||||
mAtlas->setSortExpression( expression );
|
mAtlas->setSortExpression( expression );
|
||||||
@ -228,6 +246,9 @@ void QgsLayoutAtlasWidget::updateAtlasFeatures()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasFeatureFilterCheckBox_stateChanged( int state )
|
void QgsLayoutAtlasWidget::mAtlasFeatureFilterCheckBox_stateChanged( int state )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( state == Qt::Checked )
|
if ( state == Qt::Checked )
|
||||||
{
|
{
|
||||||
mAtlasFeatureFilterEdit->setEnabled( true );
|
mAtlasFeatureFilterEdit->setEnabled( true );
|
||||||
@ -248,6 +269,9 @@ void QgsLayoutAtlasWidget::mAtlasFeatureFilterCheckBox_stateChanged( int state )
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::pageNameExpressionChanged( const QString &, bool valid )
|
void QgsLayoutAtlasWidget::pageNameExpressionChanged( const QString &, bool valid )
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
QString expression = mPageNameWidget->asExpression();
|
QString expression = mPageNameWidget->asExpression();
|
||||||
if ( !valid && !expression.isEmpty() )
|
if ( !valid && !expression.isEmpty() )
|
||||||
{
|
{
|
||||||
@ -263,6 +287,9 @@ void QgsLayoutAtlasWidget::pageNameExpressionChanged( const QString &, bool vali
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasFeatureFilterEdit_editingFinished()
|
void QgsLayoutAtlasWidget::mAtlasFeatureFilterEdit_editingFinished()
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
QString error;
|
QString error;
|
||||||
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Filter" ) );
|
mLayout->undoStack()->beginCommand( mAtlas, tr( "Change Atlas Filter" ) );
|
||||||
|
|
||||||
@ -281,6 +308,9 @@ void QgsLayoutAtlasWidget::mAtlasFeatureFilterEdit_editingFinished()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasFeatureFilterButton_clicked()
|
void QgsLayoutAtlasWidget::mAtlasFeatureFilterButton_clicked()
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mAtlasCoverageLayerComboBox->currentLayer() );
|
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mAtlasCoverageLayerComboBox->currentLayer() );
|
||||||
|
|
||||||
if ( !vl )
|
if ( !vl )
|
||||||
@ -319,6 +349,9 @@ void QgsLayoutAtlasWidget::mAtlasFeatureFilterButton_clicked()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::mAtlasSortFeatureDirectionButton_clicked()
|
void QgsLayoutAtlasWidget::mAtlasSortFeatureDirectionButton_clicked()
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
Qt::ArrowType at = mAtlasSortFeatureDirectionButton->arrowType();
|
Qt::ArrowType at = mAtlasSortFeatureDirectionButton->arrowType();
|
||||||
at = ( at == Qt::UpArrow ) ? Qt::DownArrow : Qt::UpArrow;
|
at = ( at == Qt::UpArrow ) ? Qt::DownArrow : Qt::UpArrow;
|
||||||
mAtlasSortFeatureDirectionButton->setArrowType( at );
|
mAtlasSortFeatureDirectionButton->setArrowType( at );
|
||||||
@ -333,6 +366,9 @@ void QgsLayoutAtlasWidget::mAtlasSortFeatureDirectionButton_clicked()
|
|||||||
|
|
||||||
void QgsLayoutAtlasWidget::changeFileFormat()
|
void QgsLayoutAtlasWidget::changeFileFormat()
|
||||||
{
|
{
|
||||||
|
if ( !mLayout )
|
||||||
|
return;
|
||||||
|
|
||||||
mLayout->setCustomProperty( QStringLiteral( "atlasRasterFormat" ), mAtlasFileFormat->currentText() );
|
mLayout->setCustomProperty( QStringLiteral( "atlasRasterFormat" ), mAtlasFileFormat->currentText() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class QgsLayoutAtlasWidget: public QWidget, private Ui::QgsLayoutAtlasWidgetBase
|
|||||||
void updateAtlasFeatures();
|
void updateAtlasFeatures();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QgsPrintLayout *mLayout = nullptr;
|
QPointer< QgsPrintLayout > mLayout;
|
||||||
QgsLayoutAtlas *mAtlas = nullptr;
|
QgsLayoutAtlas *mAtlas = nullptr;
|
||||||
QgsMessageBar *mMessageBar = nullptr;
|
QgsMessageBar *mMessageBar = nullptr;
|
||||||
bool mBlockUpdates = false;
|
bool mBlockUpdates = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user