Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Nov 18, 2013
2 parents 6b33631 + b8f94cb commit 24807c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mod/Sketcher/Gui/TaskSketcherValidation.cpp
Expand Up @@ -25,6 +25,7 @@

#ifndef _PreComp_
# include <Standard_math.hxx>
# include <QDoubleValidator>
# include <QLocale>
# include <QMessageBox>
# include <Inventor/nodes/SoBaseColor.h>
Expand Down Expand Up @@ -75,6 +76,8 @@ SketcherValidation::SketcherValidation(Sketcher::SketchObject* Obj, QWidget* par
ui->comboBoxTolerance->addItem(QLocale::system().toString(tolerances[i]), QVariant(tolerances[i]));
}
ui->comboBoxTolerance->setCurrentIndex(5);
ui->comboBoxTolerance->setEditable(true);
ui->comboBoxTolerance->setValidator(new QDoubleValidator(0,10,10,this));
}

SketcherValidation::~SketcherValidation()
Expand Down Expand Up @@ -200,7 +203,12 @@ void SketcherValidation::on_findButton_clicked()
}

std::set<ConstraintIds, Constraint_Less> coincidences;
double prec = ui->comboBoxTolerance->itemData(ui->comboBoxTolerance->currentIndex()).toDouble();
double prec = Precision::Confusion();
QVariant v = ui->comboBoxTolerance->itemData(ui->comboBoxTolerance->currentIndex());
if (v.isValid())
prec = v.toDouble();
else
prec = QLocale::system().toDouble(ui->comboBoxTolerance->currentText());
std::sort(vertexIds.begin(), vertexIds.end(), Vertex_Less(prec));
std::vector<VertexIds>::iterator vt = vertexIds.begin();
Vertex_EqualTo pred(prec);
Expand Down

0 comments on commit 24807c8

Please sign in to comment.