Replace boost::optional with std::optional (#4877)

This commit is contained in:
pajlada
2023-10-08 18:50:48 +02:00
committed by GitHub
parent fe4d6121a2
commit fec45889a8
88 changed files with 428 additions and 383 deletions
+7 -8
View File
@@ -42,16 +42,15 @@ float BaseWidget::scale() const
{
if (this->overrideScale_)
{
return this->overrideScale_.get();
return *this->overrideScale_;
}
else if (auto baseWidget = dynamic_cast<BaseWidget *>(this->window()))
if (auto *baseWidget = dynamic_cast<BaseWidget *>(this->window()))
{
return baseWidget->scale_;
}
else
{
return 1.f;
}
return 1.F;
}
void BaseWidget::setScale(float value)
@@ -65,13 +64,13 @@ void BaseWidget::setScale(float value)
this->setScaleIndependantSize(this->scaleIndependantSize());
}
void BaseWidget::setOverrideScale(boost::optional<float> value)
void BaseWidget::setOverrideScale(std::optional<float> value)
{
this->overrideScale_ = value;
this->setScale(this->scale());
}
boost::optional<float> BaseWidget::overrideScale() const
std::optional<float> BaseWidget::overrideScale() const
{
return this->overrideScale_;
}