Refactoring DialogTool::GetComboBoxCurrentData. Returned wrong default value.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-10-17 14:53:46 +03:00
parent 80c45f8266
commit fdc1eac734
17 changed files with 27 additions and 27 deletions

View File

@ -332,7 +332,7 @@ void DialogAlongLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogAlongLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -359,7 +359,7 @@ void DialogAlongLine::SetPointName(const QString &value)
*/
QString DialogAlongLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogArc::SetF2(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArc::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -192,7 +192,7 @@ void DialogArcWithLength::SetLength(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogArcWithLength::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -313,7 +313,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogBisector::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -355,7 +355,7 @@ void DialogBisector::closeEvent(QCloseEvent *event)
*/
QString DialogBisector::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezier::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -117,7 +117,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCubicBezierPath::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -108,7 +108,7 @@ void DialogCurveIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@ -178,7 +178,7 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogCurveIntersectAxis::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -281,7 +281,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogEndLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -375,7 +375,7 @@ DialogEndLine::~DialogEndLine()
*/
QString DialogEndLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -164,7 +164,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogHeight::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -295,7 +295,7 @@ void DialogHeight::ShowVisualization()
*/
QString DialogHeight::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ void DialogLine::SetTypeLine(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLine::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -247,5 +247,5 @@ quint32 DialogLine::GetSecondPoint() const
*/
QString DialogLine::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}

View File

@ -121,7 +121,7 @@ void DialogLineIntersectAxis::SetPointName(const QString &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------
@ -207,7 +207,7 @@ void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogLineIntersectAxis::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -242,7 +242,7 @@ void DialogNormal::SetSecondPointId(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogNormal::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -331,7 +331,7 @@ void DialogNormal::SetPointName(const QString &value)
*/
QString DialogNormal::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -267,7 +267,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogShoulderPoint::GetLineColor() const
{
return GetComboBoxCurrentData(ui->comboBoxLineColor);
return GetComboBoxCurrentData(ui->comboBoxLineColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------
@ -354,7 +354,7 @@ void DialogShoulderPoint::SetPointName(const QString &value)
*/
QString DialogShoulderPoint::GetTypeLine() const
{
return GetComboBoxCurrentData(ui->comboBoxLineType);
return GetComboBoxCurrentData(ui->comboBoxLineType, TypeLineLine);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -614,7 +614,7 @@ void DialogSpline::SetSpline(const VSpline &spline)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSpline::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -172,7 +172,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
//---------------------------------------------------------------------------------------------------------------------
QString DialogSplinePath::GetColor() const
{
return GetComboBoxCurrentData(ui->comboBoxColor);
return GetComboBoxCurrentData(ui->comboBoxColor, ColorBlack);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -302,7 +302,7 @@ void DialogTool::FillComboBoxHCrossCurvesPoint(QComboBox *box) const
}
//---------------------------------------------------------------------------------------------------------------------
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box, const QString &def) const
{
SCASSERT(box != nullptr)
QString value;
@ -313,7 +313,7 @@ QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
#endif
if (value.isEmpty())
{
value = TypeLineLine;
value = def;
}
return value;
}

View File

@ -224,7 +224,7 @@ protected:
void FillComboBoxHCrossCurvesPoint(QComboBox *box) const;
virtual void CheckState();
QString GetComboBoxCurrentData(const QComboBox *box)const;
QString GetComboBoxCurrentData(const QComboBox *box, const QString &def)const;
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString());
void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer,