Skip to content
Permalink
Browse files

Fix unable to select new projections from datum transform dialog popu…

…p box

Cherry-picked from 63370d9, fixes #31753
  • Loading branch information
nyalldawson committed Jul 4, 2019
1 parent 3c3a86b commit 94e00a28a7dc38e194eb4ad76a30a2f45d550243
Showing with 15 additions and 3 deletions.
  1. +15 −3 src/gui/qgsprojectionselectiontreewidget.cpp
@@ -95,8 +95,15 @@ QgsProjectionSelectionTreeWidget::QgsProjectionSelectionTreeWidget( QWidget *par
mRecentProjections = QgsCoordinateReferenceSystem::recentProjections();

mCheckBoxNoProjection->setHidden( true );
mCheckBoxNoProjection->setEnabled( false );
connect( mCheckBoxNoProjection, &QCheckBox::toggled, this, &QgsProjectionSelectionTreeWidget::crsSelected );
connect( mCheckBoxNoProjection, &QCheckBox::toggled, mFrameProjections, &QFrame::setDisabled );
connect( mCheckBoxNoProjection, &QCheckBox::toggled, this, [ = ]( bool checked )
{
if ( mCheckBoxNoProjection->isEnabled() )
{
mFrameProjections->setDisabled( checked );
}
} );
}

QgsProjectionSelectionTreeWidget::~QgsProjectionSelectionTreeWidget()
@@ -474,7 +481,7 @@ QString QgsProjectionSelectionTreeWidget::getSelectedExpression( const QString &

QgsCoordinateReferenceSystem QgsProjectionSelectionTreeWidget::crs() const
{
if ( mCheckBoxNoProjection->isChecked() )
if ( mCheckBoxNoProjection->isEnabled() && mCheckBoxNoProjection->isChecked() )
return QgsCoordinateReferenceSystem();

int srid = getSelectedExpression( QStringLiteral( "srs_id" ) ).toLong();
@@ -486,7 +493,12 @@ QgsCoordinateReferenceSystem QgsProjectionSelectionTreeWidget::crs() const

void QgsProjectionSelectionTreeWidget::setShowNoProjection( bool show )
{
mCheckBoxNoProjection->setHidden( !show );
mCheckBoxNoProjection->setVisible( show );
mCheckBoxNoProjection->setEnabled( show );
if ( show )
{
mFrameProjections->setDisabled( mCheckBoxNoProjection->isChecked() );
}
}

void QgsProjectionSelectionTreeWidget::setShowBoundsMap( bool show )

0 comments on commit 94e00a2

Please sign in to comment.
You can’t perform that action at this time.