diff -r 01537fbe096e -r 8d88adffb779 src/ui/circletooloptionswidget.cpp --- a/src/ui/circletooloptionswidget.cpp Tue Apr 11 22:51:47 2023 +0300 +++ b/src/ui/circletooloptionswidget.cpp Wed Apr 12 01:53:42 2023 +0300 @@ -1,21 +1,21 @@ #include "src/ui/circletooloptionswidget.h" -static QString circularPrimitiveTypeName(CircularPrimitive::Type type) +static QString circularPrimitiveTypeName(circular_primitive_type_e type) { switch (type) { - case CircularPrimitive::Circle: + case circular_primitive_type_e::circle: return CircleToolOptionsWidget::tr("Circle"); - case CircularPrimitive::Disc: + case circular_primitive_type_e::disc: return CircleToolOptionsWidget::tr("Disc"); - case CircularPrimitive::Cylinder: + case circular_primitive_type_e::cylinder: return CircleToolOptionsWidget::tr("Cylinder"); - case CircularPrimitive::CylinderOpen: + case circular_primitive_type_e::cylinder_open: return CircleToolOptionsWidget::tr("Cylinder open"); - case CircularPrimitive::CylinderClosed: + case circular_primitive_type_e::cylinder_closed: return CircleToolOptionsWidget::tr("Cylinder closed"); - case CircularPrimitive::DiscNegative: + case circular_primitive_type_e::disc_negative: return CircleToolOptionsWidget::tr("Disc negative"); - case CircularPrimitive::Chord: + case circular_primitive_type_e::chord: return CircleToolOptionsWidget::tr("Chord"); } return ""; @@ -25,9 +25,9 @@ QWidget{parent} { this->ui.setupUi(this); - for (int i = 0; i < CircularPrimitive::NUM_TYPES; ++i) { - const auto type = static_cast(i); - this->ui.type->addItem(circularPrimitiveTypeName(type), type); + for (int i = 0; i < circular_primitive::NUM_TYPES; ++i) { + const auto type = static_cast(i); + this->ui.type->addItem(circularPrimitiveTypeName(type), QVariant::fromValue(type)); } connect(ui.segments, qOverload(&QSpinBox::valueChanged), this, &CircleToolOptionsWidget::handleInputChange); connect(ui.divisions, &QComboBox::currentTextChanged, this, &CircleToolOptionsWidget::handleInputChange); @@ -55,9 +55,9 @@ } } -CircularPrimitive::Type CircleToolOptionsWidget::type() const +circular_primitive_type_e CircleToolOptionsWidget::type() const { - return this->ui.type->currentData().value(); + return this->ui.type->currentData().value(); } void CircleToolOptionsWidget::handleInputChange()