Use unique_ptr on all ui objects from .ui files (#5511)

* Forward declare ui and use unique_ptr

* ConfigureEnhancements: use unique_ptr for ui

* Use make_unique instead of new where applicable

* Move some of the ui includes that already used unique_ptr

* main.cpp: also make use of make_unique on Config

* Address review comments
This commit is contained in:
Vitor K 2020-09-30 22:23:01 -03:00 committed by GitHub
parent a576eb633f
commit a26b466ac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 257 additions and 229 deletions

View file

@ -228,7 +228,8 @@ static constexpr int SettingsToSlider(int value) {
return (value - 5) / 5;
}
ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) {
ConfigureSystem::ConfigureSystem(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureSystem>()) {
ui->setupUi(this);
connect(ui->combo_birthmonth,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,