MeshPart: fix -Wclazy-connect-by-name
This commit is contained in:
@@ -172,6 +172,8 @@ CrossSections::CrossSections(const Base::BoundBox3d& bb, QWidget* parent, Qt::Wi
|
||||
{
|
||||
ui = new Ui_CrossSections();
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
ui->position->setRange(-DBL_MAX, DBL_MAX);
|
||||
ui->position->setUnit(Base::Unit::Length);
|
||||
ui->distance->setRange(0, DBL_MAX);
|
||||
@@ -203,6 +205,27 @@ CrossSections::~CrossSections()
|
||||
delete vp;
|
||||
}
|
||||
|
||||
void CrossSections::setupConnections()
|
||||
{
|
||||
connect(ui->xyPlane, &QRadioButton::clicked,
|
||||
this, &CrossSections::xyPlaneClicked);
|
||||
connect(ui->xzPlane, &QRadioButton::clicked,
|
||||
this, &CrossSections::xzPlaneClicked);
|
||||
connect(ui->yzPlane, &QRadioButton::clicked,
|
||||
this, &CrossSections::yzPlaneClicked);
|
||||
connect(ui->position, qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
|
||||
this, &CrossSections::positionValueChanged);
|
||||
connect(ui->distance, qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
|
||||
this, &CrossSections::distanceValueChanged);
|
||||
connect(ui->countSections, qOverload<int>(&QSpinBox::valueChanged),
|
||||
this, &CrossSections::countSectionsValueChanged);
|
||||
connect(ui->checkBothSides, &QCheckBox::toggled,
|
||||
this, &CrossSections::checkBothSidesToggled);
|
||||
connect(ui->sectionsBox, &QGroupBox::toggled,
|
||||
this, &CrossSections::sectionsBoxToggled);
|
||||
|
||||
}
|
||||
|
||||
CrossSections::Plane CrossSections::plane() const
|
||||
{
|
||||
if (ui->xyPlane->isChecked())
|
||||
@@ -345,7 +368,7 @@ void CrossSections::apply()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CrossSections::on_xyPlane_clicked()
|
||||
void CrossSections::xyPlaneClicked()
|
||||
{
|
||||
Base::Vector3d c = bbox.GetCenter();
|
||||
ui->position->setValue(c.z);
|
||||
@@ -361,7 +384,7 @@ void CrossSections::on_xyPlane_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void CrossSections::on_xzPlane_clicked()
|
||||
void CrossSections::xzPlaneClicked()
|
||||
{
|
||||
Base::Vector3d c = bbox.GetCenter();
|
||||
ui->position->setValue(c.y);
|
||||
@@ -377,7 +400,7 @@ void CrossSections::on_xzPlane_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void CrossSections::on_yzPlane_clicked()
|
||||
void CrossSections::yzPlaneClicked()
|
||||
{
|
||||
Base::Vector3d c = bbox.GetCenter();
|
||||
ui->position->setValue(c.x);
|
||||
@@ -393,7 +416,7 @@ void CrossSections::on_yzPlane_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void CrossSections::on_position_valueChanged(double v)
|
||||
void CrossSections::positionValueChanged(double v)
|
||||
{
|
||||
if (!ui->sectionsBox->isChecked()) {
|
||||
calcPlane(plane(), v);
|
||||
@@ -403,10 +426,10 @@ void CrossSections::on_position_valueChanged(double v)
|
||||
}
|
||||
}
|
||||
|
||||
void CrossSections::on_sectionsBox_toggled(bool b)
|
||||
void CrossSections::sectionsBoxToggled(bool ok)
|
||||
{
|
||||
if (b) {
|
||||
on_countSections_valueChanged(ui->countSections->value());
|
||||
if (ok) {
|
||||
countSectionsValueChanged(ui->countSections->value());
|
||||
}
|
||||
else {
|
||||
CrossSections::Plane type = plane();
|
||||
@@ -429,7 +452,7 @@ void CrossSections::on_sectionsBox_toggled(bool b)
|
||||
}
|
||||
}
|
||||
|
||||
void CrossSections::on_checkBothSides_toggled(bool b)
|
||||
void CrossSections::checkBothSidesToggled(bool b)
|
||||
{
|
||||
double d = ui->distance->value().getValue();
|
||||
d = b ? 2.0 * d : 0.5 * d;
|
||||
@@ -437,7 +460,7 @@ void CrossSections::on_checkBothSides_toggled(bool b)
|
||||
calcPlanes(plane());
|
||||
}
|
||||
|
||||
void CrossSections::on_countSections_valueChanged(int v)
|
||||
void CrossSections::countSectionsValueChanged(int v)
|
||||
{
|
||||
CrossSections::Plane type = plane();
|
||||
double dist = 0;
|
||||
@@ -458,7 +481,7 @@ void CrossSections::on_countSections_valueChanged(int v)
|
||||
calcPlanes(type);
|
||||
}
|
||||
|
||||
void CrossSections::on_distance_valueChanged(double)
|
||||
void CrossSections::distanceValueChanged(double)
|
||||
{
|
||||
calcPlanes(plane());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user