Skip to content

Commit

Permalink
Fix usage of deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jan 15, 2020
1 parent c5d9ca4 commit cafa7ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/plugins/geometry_checker/qgsgeometrycheckerresulttab.cpp
Expand Up @@ -580,14 +580,14 @@ void QgsGeometryCheckerResultTab::setDefaultResolutionMethods()
groupBoxLayout->setContentsMargins( 2, 0, 2, 2 );
QButtonGroup *radioGroup = new QButtonGroup( groupBox );
radioGroup->setProperty( "errorType", check->id() );
int id = 0;
int checkedId = QgsSettings().value( sSettingsGroup + check->id(), QVariant::fromValue<int>( 0 ) ).toInt();
for ( const QString &method : check->resolutionMethods() )
const QList<QgsGeometryCheckResolutionMethod> resolutionMethods = check->availableResolutionMethods();
for ( const QgsGeometryCheckResolutionMethod &method : resolutionMethods )
{
QRadioButton *radio = new QRadioButton( method, groupBox );
radio->setChecked( id == checkedId );
QRadioButton *radio = new QRadioButton( method.name(), groupBox );
radio->setChecked( method.id() == checkedId );
groupBoxLayout->addWidget( radio );
radioGroup->addButton( radio, id++ );
radioGroup->addButton( radio, method.id() );
}
connect( radioGroup, static_cast<void ( QButtonGroup::* )( int )>( &QButtonGroup::buttonClicked ), this, &QgsGeometryCheckerResultTab::storeDefaultResolutionMethod );

Expand Down
10 changes: 5 additions & 5 deletions src/plugins/geometry_checker/qgsgeometrycheckfixdialog.cpp
Expand Up @@ -104,14 +104,14 @@ void QgsGeometryCheckerFixDialog::setupNextError()
mResolutionsBox->setLayout( new QVBoxLayout() );
mResolutionsBox->layout()->setContentsMargins( 0, 0, 0, 4 );

int id = 0;
int checkedid = QgsSettings().value( QgsGeometryCheckerResultTab::sSettingsGroup + error->check()->id(), QVariant::fromValue<int>( 0 ) ).toInt();
for ( const QString &method : error->check()->resolutionMethods() )
const QList<QgsGeometryCheckResolutionMethod> resolutionMethods = error->check()->availableResolutionMethods();
for ( const QgsGeometryCheckResolutionMethod &method : resolutionMethods )
{
QRadioButton *radio = new QRadioButton( method );
radio->setChecked( checkedid == id );
QRadioButton *radio = new QRadioButton( method.name() );
radio->setChecked( checkedid == method.id() );
mResolutionsBox->layout()->addWidget( radio );
mRadioGroup->addButton( radio, id++ );
mRadioGroup->addButton( radio, method.id() );
}
adjustSize();
}
Expand Down

0 comments on commit cafa7ba

Please sign in to comment.