[finished] Handle Qt 6.7 deprecations in checkbox

This commit is contained in:
Adriaan de Groot 2024-12-02 22:07:01 +01:00
parent a87487020a
commit a067e4fc4f

View File

@ -41,9 +41,15 @@ FinishedPage::FinishedPage( Config* config, QWidget* parent )
ui->restartCheckBox->setEnabled( mode != Mode::Always );
} );
connect( config, &Config::restartNowWantedChanged, ui->restartCheckBox, &QCheckBox::setChecked );
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
connect( ui->restartCheckBox,
&QCheckBox::stateChanged,
[ config ]( int state ) { config->setRestartNowWanted( state != 0 ); } );
#else
connect( ui->restartCheckBox,
&QCheckBox::checkStateChanged,
[ config ]( Qt::CheckState state ) { config->setRestartNowWanted( state != Qt::Unchecked ); } );
#endif
CALAMARES_RETRANSLATE_SLOT( &FinishedPage::retranslate );
}