Skip to content

Commit

Permalink
Fix unable to select new projections from datum transform dialog popu…
Browse files Browse the repository at this point in the history
…p box

Cherry-picked from 63370d9, fixes #31753
  • Loading branch information
nyalldawson committed Dec 16, 2019
1 parent 3c3a86b commit 94e00a2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/gui/qgsprojectionselectiontreewidget.cpp
Expand Up @@ -95,8 +95,15 @@ QgsProjectionSelectionTreeWidget::QgsProjectionSelectionTreeWidget( QWidget *par
mRecentProjections = QgsCoordinateReferenceSystem::recentProjections(); mRecentProjections = QgsCoordinateReferenceSystem::recentProjections();


mCheckBoxNoProjection->setHidden( true ); mCheckBoxNoProjection->setHidden( true );
mCheckBoxNoProjection->setEnabled( false );
connect( mCheckBoxNoProjection, &QCheckBox::toggled, this, &QgsProjectionSelectionTreeWidget::crsSelected ); 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() QgsProjectionSelectionTreeWidget::~QgsProjectionSelectionTreeWidget()
Expand Down Expand Up @@ -474,7 +481,7 @@ QString QgsProjectionSelectionTreeWidget::getSelectedExpression( const QString &


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


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


void QgsProjectionSelectionTreeWidget::setShowNoProjection( bool show ) 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 ) void QgsProjectionSelectionTreeWidget::setShowBoundsMap( bool show )
Expand Down

0 comments on commit 94e00a2

Please sign in to comment.