<div dir="ltr">Hi Gerald,<div><br></div><div>It looks like this isn't necessarily a quick change. I have filed a bug report here:</div><div><br></div><div><a href="http://www.paraview.org/Bug/view.php?id=15786">http://www.paraview.org/Bug/view.php?id=15786</a><br></div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 10:31 AM, Lodron, Gerald <span dir="ltr"><<a href="mailto:Gerald.Lodron@joanneum.at" target="_blank">Gerald.Lodron@joanneum.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I searched "DoubleValidator" in complete PV source and also found same usage in other classes.I am currently not in office but you can easily search with Visual studio or other programms. Or wait till end next week.<br>
<br>
I teseted the Qlocator::setDefault function in a constructor of a plugin of mine to set PV locale to english but no success.may it must be called directly in main before first qt stuff<br>
<br>
Best regards<br>
<br>
<br>
Von Samsung Mobile gesendet<br>
<br>
<br>
-------- Ursprüngliche Nachricht --------<br>
Von: Cory Quammen<br>
Datum:16.10.2015 16:20 (GMT+01:00)<br>
An: "Lodron, Gerald"<br>
Cc: "Paraview User (<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>)" ,"Paraview Developer (<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.org</a>)"<br>
Betreff: Re: [Paraview-developers] Locale settings in PV<br>
<span class=""><br>
Hi Gerald,<br>
<br>
Thanks for your report and fix.<br>
<br>
It looks like pqDoubleEdit is used only in the PointSprite plugin. Are you seeing this problem only in the PointSprite plugin, or do you see problems more widely in ParaView?<br>
<br>
Thanks,<br>
Cory<br>
<br>
</span><span class="">On Thu, Oct 15, 2015 at 5:46 AM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a><mailto:<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>> wrote:<br>
Hello<br>
<br>
I noticed a bug in paraview on parsing double values in QLineEdits, e.g. in pqDoubleEdit:<br>
<br>
double pqDoubleEdit::value()<br>
{<br>
  QString currentText = this->text();<br>
  int currentPos = this->cursorPosition();<br>
  QDoubleValidator dvalidator(NULL);<br>
  QValidator::State state = dvalidator.validate(currentText, currentPos);<br>
  if (state == QValidator::Acceptable || state == QValidator::Intermediate)<br>
    {<br>
    return currentText.toDouble();<br>
    }<br>
  return 0.0;<br>
}<br>
<br>
</span>The Problem is that QDoubleValidator uses the current locale. If the current locale is e.g. German that e.g. "0.1" is not allowed, only "0,1". On the other side the QString function toDouble cannot parse it correctly, see documentation <a href="http://doc.qt.io/qt-5/qstring.html#toDouble" rel="noreferrer" target="_blank">http://doc.qt.io/qt-5/qstring.html#toDouble</a> , here the <a href="http://doc.qt.io/qt-5/qlocale.html#toDouble" rel="noreferrer" target="_blank">http://doc.qt.io/qt-5/qlocale.html#toDouble</a> is recommended.... So all QLineEdit functions with toDouble must be replaced by<br>
<span class="">QLocale oL;<br>
Double dValue = oL.toDouble( lineEdit->text())<br>
<br>
</span>Nasty....Other solution would be to set the locale to English for whole paraview regardless to the system locale, but I don't know if that is possible (also not very beautiful)...<br>
<span class=""><br>
Best regards<br>
<br>
<br>
------------------------------------------------------------------------------------<br>
Gerald Lodron<br>
<br>
Researcher of Machine Vision Applications Group<br>
DIGITAL - Institute for Information and Communication Technologies<br>
<br>
JOANNEUM RESEARCH Forschungsgesellschaft mbH<br>
Steyrergasse 17, 8010 Graz, AUSTRIA<br>
<br>
</span>phone:   <a href="tel:%2B43-316-876-1751" value="+433168761751">+43-316-876-1751</a><tel:%2B43-316-876-1751><br>
general fax: <a href="tel:%2B43-316-876-1751" value="+433168761751">+43-316-876-1751</a><tel:%2B43-316-876-1751><br>
web: <a href="http://www.joanneum.at/digital" rel="noreferrer" target="_blank">http://www.joanneum.at/digital</a><br>
e-mail: <a href="mailto:gerald.lodron@joanneum.at">gerald.lodron@joanneum.at</a><mailto:<a href="mailto:gerald.lodron@joanneum.at">gerald.lodron@joanneum.at</a>><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><<a href="http://www.kitware.com" rel="noreferrer" target="_blank">http://www.kitware.com</a>><br>
<div class="HOEnZb"><div class="h5"><br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br>
<br>
<br>
<br>
--<br>
Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>