Refactoring.
This commit is contained in:
parent
672278209d
commit
22d21a867a
|
@ -406,19 +406,9 @@ void DialogSetupMultisize::ZDimensionBodyMeasurementChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSetupMultisize::CheckState()
|
void DialogSetupMultisize::CheckDimension(QGroupBox *group, QGroupBox *nameGroup, QLineEdit *lineEdit,
|
||||||
{
|
bool &dimensionValid, int &dimensions,
|
||||||
ui->labelError->clear();
|
const MeasurementDimension_p &dimension)
|
||||||
|
|
||||||
bool xDimensionValid = true;
|
|
||||||
bool yDimensionValid = true;
|
|
||||||
bool wDimensionValid = true;
|
|
||||||
bool zDimensionValid = true;
|
|
||||||
|
|
||||||
int dimensions = 0;
|
|
||||||
|
|
||||||
auto CheckDimension = [this](QGroupBox *group, QGroupBox *nameGroup, QLineEdit *lineEdit, bool &dimensionValid,
|
|
||||||
int &dimensions, const MeasurementDimension_p &dimension)
|
|
||||||
{
|
{
|
||||||
SCASSERT(group != nullptr)
|
SCASSERT(group != nullptr)
|
||||||
SCASSERT(nameGroup != nullptr)
|
SCASSERT(nameGroup != nullptr)
|
||||||
|
@ -444,7 +434,19 @@ void DialogSetupMultisize::CheckState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogSetupMultisize::CheckState()
|
||||||
|
{
|
||||||
|
ui->labelError->clear();
|
||||||
|
|
||||||
|
bool xDimensionValid = true;
|
||||||
|
bool yDimensionValid = true;
|
||||||
|
bool wDimensionValid = true;
|
||||||
|
bool zDimensionValid = true;
|
||||||
|
|
||||||
|
int dimensions = 0;
|
||||||
|
|
||||||
CheckDimension(ui->groupBoxXDimension, ui->groupBoxCustomXDimensionName, ui->lineEditCustomXDimensionName,
|
CheckDimension(ui->groupBoxXDimension, ui->groupBoxCustomXDimensionName, ui->lineEditCustomXDimensionName,
|
||||||
xDimensionValid, dimensions, m_xDimension);
|
xDimensionValid, dimensions, m_xDimension);
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||||
|
|
||||||
class QDoubleSpinBox;
|
class QDoubleSpinBox;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLineEdit;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
@ -76,6 +78,8 @@ private:
|
||||||
QSharedPointer<VWMeasurementDimension> m_wDimension;
|
QSharedPointer<VWMeasurementDimension> m_wDimension;
|
||||||
QSharedPointer<VZMeasurementDimension> m_zDimension;
|
QSharedPointer<VZMeasurementDimension> m_zDimension;
|
||||||
|
|
||||||
|
void CheckDimension(QGroupBox *group, QGroupBox *nameGroup, QLineEdit *lineEdit, bool &dimensionValid,
|
||||||
|
int &dimensions, const MeasurementDimension_p &dimension);
|
||||||
void CheckState();
|
void CheckState();
|
||||||
|
|
||||||
void InitDimensionMinMax(QDoubleSpinBox *doubleSpinBoxMinValue, QDoubleSpinBox *doubleSpinBoxMaxValue,
|
void InitDimensionMinMax(QDoubleSpinBox *doubleSpinBoxMinValue, QDoubleSpinBox *doubleSpinBoxMaxValue,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user