Commit 708a25d0 authored by Stefan Gerlach's avatar Stefan Gerlach

[locale] matrix, etc. and analysis docks

parent ef98d4d9
......@@ -1771,7 +1771,7 @@ void XYCurvePrivate::updateValues() {
if (!m_pointVisible.at(i++)) continue;
QString value;
if (rangeFormat == CartesianPlot::RangeFormat::Numeric)
value = QString::number(point.x(), valuesNumericFormat, precision);
value = QLocale().toString(point.x(), valuesNumericFormat, precision);
else
value = QDateTime::fromMSecsSinceEpoch(point.x()).toString(valuesDateTimeFormat);
m_valueStrings << valuesPrefix + value + valuesSuffix;
......@@ -1787,7 +1787,7 @@ void XYCurvePrivate::updateValues() {
if (!m_pointVisible.at(i++)) continue;
QString value;
if (rangeFormat == CartesianPlot::RangeFormat::Numeric)
value = QString::number(point.y(), valuesNumericFormat, precision);
value = QLocale().toString(point.y(), valuesNumericFormat, precision);
else
value = QDateTime::fromMSecsSinceEpoch(point.y()).toString(valuesDateTimeFormat);
m_valueStrings << valuesPrefix + value + valuesSuffix;
......@@ -1813,12 +1813,12 @@ void XYCurvePrivate::updateValues() {
if (valuesType == XYCurve::ValuesType::XYBracketed)
value = '(';
if (xRangeFormat == CartesianPlot::RangeFormat::Numeric)
value += QString::number(point.x(), valuesNumericFormat, xPrecision);
value += QLocale().toString(point.x(), valuesNumericFormat, xPrecision);
else
value += QDateTime::fromMSecsSinceEpoch(point.x()).toString(valuesDateTimeFormat);
if (yRangeFormat == CartesianPlot::RangeFormat::Numeric)
value += ',' + QString::number(point.y(), valuesNumericFormat, yPrecision);
value += ',' + QLocale().toString(point.y(), valuesNumericFormat, yPrecision);
else
value += ',' + QDateTime::fromMSecsSinceEpoch(point.y()).toString(valuesDateTimeFormat);
......@@ -1845,11 +1845,11 @@ void XYCurvePrivate::updateValues() {
switch (xColMode) {
case AbstractColumn::ColumnMode::Numeric:
m_valueStrings << valuesPrefix + QString::number(valuesColumn->valueAt(i), valuesNumericFormat, valuesPrecision) + valuesSuffix;
m_valueStrings << valuesPrefix + QLocale().toString(valuesColumn->valueAt(i), valuesNumericFormat, valuesPrecision) + valuesSuffix;
break;
case AbstractColumn::ColumnMode::Integer:
case AbstractColumn::ColumnMode::BigInt:
m_valueStrings << valuesPrefix + QString::number(valuesColumn->valueAt(i)) + valuesSuffix;
m_valueStrings << valuesPrefix + QLocale().toString(valuesColumn->valueAt(i)) + valuesSuffix;
break;
case AbstractColumn::ColumnMode::Text:
m_valueStrings << valuesPrefix + valuesColumn->textAt(i) + valuesSuffix;
......@@ -1880,20 +1880,16 @@ void XYCurvePrivate::updateValues() {
switch (valuesPosition) {
case XYCurve::ValuesPosition::Above:
tempPoint.setX(x - w/2.);
tempPoint.setY(y - valuesDistance);
tempPoint = QPointF(x - w/2., y - valuesDistance);
break;
case XYCurve::ValuesPosition::Under:
tempPoint.setX(x - w/2.);
tempPoint.setY(y + valuesDistance + h/2.);
tempPoint = QPointF(x - w/2., y + valuesDistance + h/2.);
break;
case XYCurve::ValuesPosition::Left:
tempPoint.setX(x - valuesDistance - w - 1.);
tempPoint.setY(y);
tempPoint = QPointF(x - valuesDistance - w - 1., y);
break;
case XYCurve::ValuesPosition::Right:
tempPoint.setX(x + valuesDistance - 1.);
tempPoint.setY(y);
tempPoint = QPointF(x + valuesDistance - 1., y);
break;
}
m_valuePoints.append(tempPoint);
......
......@@ -59,7 +59,7 @@ CartesianPlotLegendDock::CartesianPlotLegendDock(QWidget* parent) : BaseDock(par
labelWidget->setGeometryAvailable(false);
labelWidget->setBorderAvailable(false);
hboxLayout->addWidget(labelWidget);
hboxLayout->setContentsMargins(2,2,2,2);
hboxLayout->setContentsMargins(2, 2, 2, 2);
hboxLayout->setSpacing(2);
//"Background"-tab
......
......@@ -119,7 +119,7 @@ void CustomPointDock::setPoints(QList<CustomPoint*> list) {
m_aspect = list.first();
Q_ASSERT(m_point);
//if there are more then one point in the list, disable the comment and name widgets in the tab "general"
//if there is more then one point in the list, disable the comment and name widgets in "general"
if (list.size() == 1) {
ui.lName->setEnabled(true);
ui.leName->setEnabled(true);
......@@ -164,22 +164,28 @@ void CustomPointDock::positionXChanged() {
if (m_initializing)
return;
QPointF pos = m_point->position();
float x = ui.lePositionX->text().toFloat();
pos.setX(x);
for (auto* point : m_pointsList)
point->setPosition(pos);
bool ok;
double x = QLocale().toDouble(ui.lePositionX->text(), &ok);
if (ok) {
QPointF pos{m_point->position()};
pos.setX(x);
for (auto* point : m_pointsList)
point->setPosition(pos);
}
}
void CustomPointDock::positionYChanged() {
if (m_initializing)
return;
QPointF pos = m_point->position();
float y = ui.lePositionY->text().toFloat();
pos.setY(y);
for (auto* point : m_pointsList)
point->setPosition(pos);
bool ok;
double y = QLocale().toDouble(ui.lePositionY->text(), &ok);
if (ok) {
QPointF pos{m_point->position()};
pos.setY(y);
for (auto* point : m_pointsList)
point->setPosition(pos);
}
}
void CustomPointDock::visibilityChanged(bool state) {
......@@ -241,7 +247,7 @@ void CustomPointDock::symbolOpacityChanged(int value) {
if (m_initializing)
return;
qreal opacity = (float)value/100.;
qreal opacity = (double)value/100.;
m_point->beginMacro(i18n("%1 CustomPoints: opacity changed", m_pointsList.count()));
for (auto* point : m_pointsList)
point->setSymbolOpacity(opacity);
......@@ -279,14 +285,14 @@ void CustomPointDock::symbolFillingColorChanged(const QColor& color) {
m_point->endMacro();
m_initializing = true;
GuiTools::updateBrushStyles(ui.cbSymbolFillingStyle, color );
GuiTools::updateBrushStyles(ui.cbSymbolFillingStyle, color);
m_initializing = false;
}
void CustomPointDock::symbolBorderStyleChanged(int index) {
auto penStyle = Qt::PenStyle(index);
if ( penStyle == Qt::NoPen ) {
if (penStyle == Qt::NoPen) {
ui.kcbSymbolBorderColor->setEnabled(false);
ui.sbSymbolBorderWidth->setEnabled(false);
} else {
......@@ -358,8 +364,8 @@ void CustomPointDock::pointDescriptionChanged(const AbstractAspect* aspect) {
void CustomPointDock::pointPositionChanged(QPointF position) {
m_initializing = true;
ui.lePositionX->setText(QString::number(position.x()));
ui.lePositionY->setText(QString::number(position.y()));
ui.lePositionX->setText(QLocale().toString(position.x()));
ui.lePositionY->setText(QLocale().toString(position.y()));
m_initializing = false;
}
......@@ -420,8 +426,8 @@ void CustomPointDock::load() {
m_initializing = true;
ui.lePositionX->setText(QString::number(m_point->position().x()));
ui.lePositionY->setText(QString::number(m_point->position().y()));
ui.lePositionX->setText(QLocale().toString(m_point->position().x()));
ui.lePositionY->setText(QLocale().toString(m_point->position().y()));
ui.cbSymbolStyle->setCurrentIndex( (int)m_point->symbolStyle() );
ui.sbSymbolSize->setValue( Worksheet::convertFromSceneUnits(m_point->symbolSize(), Worksheet::Unit::Point) );
......
......@@ -94,7 +94,7 @@ void MatrixDock::setMatrices(QList<Matrix*> list) {
ui.leName->setText(m_matrix->name());
ui.leComment->setText(m_matrix->comment());
} else {
//disable the fields "Name" and "Comment" if there are more the one matrix
//disable these fields if there is more than one matrix
ui.leName->setEnabled(false);
ui.leComment->setEnabled(false);
......@@ -135,9 +135,12 @@ void MatrixDock::xStartChanged() {
QString str = ui.leXStart->text().trimmed();
if (str.isEmpty()) return;
double value = str.toDouble();
for (auto* matrix : m_matrixList)
matrix->setXStart(value);
bool ok;
const double value{ QLocale().toDouble(str, &ok) };
if (ok) {
for (auto* matrix : m_matrixList)
matrix->setXStart(value);
}
}
void MatrixDock::xEndChanged() {
......@@ -146,9 +149,12 @@ void MatrixDock::xEndChanged() {
QString str = ui.leXEnd->text().trimmed();
if (str.isEmpty()) return;
double value = str.toDouble();
for (auto* matrix : m_matrixList)
matrix->setXEnd(value);
bool ok;
const double value{ QLocale().toDouble(str, &ok) };
if (ok) {
for (auto* matrix : m_matrixList)
matrix->setXEnd(value);
}
}
void MatrixDock::yStartChanged() {
......@@ -157,9 +163,12 @@ void MatrixDock::yStartChanged() {
QString str = ui.leYStart->text().trimmed();
if (str.isEmpty()) return;
double value = str.toDouble();
for (auto* matrix : m_matrixList)
matrix->setYStart(value);
bool ok;
const double value{ QLocale().toDouble(str, &ok) };
if (ok) {
for (auto* matrix : m_matrixList)
matrix->setYStart(value);
}
}
void MatrixDock::yEndChanged() {
......@@ -168,9 +177,12 @@ void MatrixDock::yEndChanged() {
QString str = ui.leYEnd->text().trimmed();
if (str.isEmpty()) return;
double value = str.toDouble();
for (auto* matrix : m_matrixList)
matrix->setYEnd(value);
bool ok;
const double value{ QLocale().toDouble(str, &ok) };
if (ok) {
for (auto* matrix : m_matrixList)
matrix->setYEnd(value);
}
}
//format
......@@ -248,25 +260,25 @@ void MatrixDock::matrixColumnCountChanged(int count) {
//mapping to the logical coordinates
void MatrixDock::matrixXStartChanged(double value) {
m_initializing = true;
ui.leXStart->setText(QString::number(value));
ui.leXStart->setText(QLocale().toString(value));
m_initializing = false;
}
void MatrixDock::matrixXEndChanged(double value) {
m_initializing = true;
ui.leXEnd->setText(QString::number(value));
ui.leXEnd->setText(QLocale().toString(value));
m_initializing = false;
}
void MatrixDock::matrixYStartChanged(double value) {
m_initializing = true;
ui.leYStart->setText(QString::number(value));
ui.leYStart->setText(QLocale().toString(value));
m_initializing = false;
}
void MatrixDock::matrixYEndChanged(double value) {
m_initializing = true;
ui.leYEnd->setText(QString::number(value));
ui.leYEnd->setText(QLocale().toString(value));
m_initializing = false;
}
......@@ -299,10 +311,10 @@ void MatrixDock::load() {
ui.sbColumnCount->setValue(m_matrix->columnCount());
//mapping to the logical coordinates
ui.leXStart->setText(QString::number(m_matrix->xStart()));
ui.leXEnd->setText(QString::number(m_matrix->xEnd()));
ui.leYStart->setText(QString::number(m_matrix->yStart()));
ui.leYEnd->setText(QString::number(m_matrix->yEnd()));
ui.leXStart->setText(QLocale().toString(m_matrix->xStart()));
ui.leXEnd->setText(QLocale().toString(m_matrix->xEnd()));
ui.leYStart->setText(QLocale().toString(m_matrix->yStart()));
ui.leYEnd->setText(QLocale().toString(m_matrix->yEnd()));
//format
ui.cbFormat->setCurrentIndex(ui.cbFormat->findData((int)m_matrix->numericFormat()));
......@@ -341,10 +353,10 @@ void MatrixDock::loadConfig(KConfig& config) {
ui.sbColumnCount->setValue(group.readEntry("ColumnCount", m_matrix->columnCount()));
//mapping to the logical coordinates
ui.leXStart->setText( QString::number(group.readEntry("XStart", m_matrix->xStart())) );
ui.leXEnd->setText( QString::number(group.readEntry("XEnd", m_matrix->xEnd())) );
ui.leYStart->setText( QString::number(group.readEntry("YStart", m_matrix->yStart())) );
ui.leYEnd->setText( QString::number(group.readEntry("YEnd", m_matrix->yEnd())) );
ui.leXStart->setText( QLocale().toString(group.readEntry("XStart", m_matrix->xStart())) );
ui.leXEnd->setText( QLocale().toString(group.readEntry("XEnd", m_matrix->xEnd())) );
ui.leYStart->setText( QLocale().toString(group.readEntry("YStart", m_matrix->yStart())) );
ui.leYEnd->setText( QLocale().toString(group.readEntry("YEnd", m_matrix->yEnd())) );
//format
ui.cbFormat->setCurrentIndex( ui.cbFormat->findData(group.readEntry("NumericFormat", QString(m_matrix->numericFormat()))) );
......@@ -363,10 +375,10 @@ void MatrixDock::saveConfigAsTemplate(KConfig& config) {
group.writeEntry("ColumnCount", ui.sbColumnCount->value());
//mapping to the logical coordinates
group.writeEntry("XStart", ui.leXStart->text().toInt());
group.writeEntry("XEnd", ui.leXEnd->text().toInt());
group.writeEntry("YStart", ui.leYStart->text().toInt());
group.writeEntry("YEnd", ui.leYEnd->text().toInt());
group.writeEntry("XStart", QLocale().toDouble(ui.leXStart->text()) );
group.writeEntry("XEnd", QLocale().toDouble(ui.leXEnd->text()) );
group.writeEntry("YStart", QLocale().toDouble(ui.leYStart->text()) );
group.writeEntry("YEnd", QLocale().toDouble(ui.leYEnd->text()) );
//format
group.writeEntry("NumericFormat", ui.cbFormat->itemData(ui.cbFormat->currentIndex()));
......
......@@ -72,7 +72,7 @@ void ReferenceLineDock::setReferenceLines(QList<ReferenceLine*> list) {
m_aspect = list.first();
Q_ASSERT(m_line);
//if there are more then one point in the list, disable the comment and name widgets in the tab "general"
//if there is more then one point in the list, disable the comment and name widgets in "general"
if (list.size() == 1) {
ui.lName->setEnabled(true);
ui.leName->setEnabled(true);
......@@ -129,9 +129,12 @@ void ReferenceLineDock::positionChanged() {
if (m_initializing)
return;
double pos = ui.lePosition->text().toDouble();
for (auto* line : m_linesList)
line->setPosition(pos);
bool ok;
const double pos{ QLocale().toDouble(ui.lePosition->text(), &ok) };
if (ok) {
for (auto* line : m_linesList)
line->setPosition(pos);
}
}
//Line
......@@ -152,9 +155,8 @@ void ReferenceLineDock::colorChanged(const QColor& color) {
if (m_initializing)
return;
QPen pen;
for (auto* line : m_linesList) {
pen = line->pen();
QPen pen = line->pen();
pen.setColor(color);
line->setPen(pen);
}
......@@ -168,9 +170,8 @@ void ReferenceLineDock::widthChanged(double value) {
if (m_initializing)
return;
QPen pen;
for (auto* line : m_linesList) {
pen = line->pen();
QPen pen = line->pen();
pen.setWidthF( Worksheet::convertToSceneUnits(value, Worksheet::Unit::Point) );
line->setPen(pen);
}
......@@ -180,7 +181,7 @@ void ReferenceLineDock::opacityChanged(int value) {
if (m_initializing)
return;
qreal opacity = (float)value/100.;
qreal opacity = (double)value/100.;
for (auto* line : m_linesList)
line->setOpacity(opacity);
}
......@@ -252,7 +253,7 @@ void ReferenceLineDock::load() {
m_initializing = true;
ui.cbOrientation->setCurrentIndex(static_cast<int>(m_line->orientation()));
ui.lePosition->setText(QString::number(m_line->position()));
ui.lePosition->setText(QLocale().toString(m_line->position()));
ui.cbLineStyle->setCurrentIndex( (int) m_line->pen().style() );
ui.kcbLineColor->setColor( m_line->pen().color() );
ui.sbLineWidth->setValue( Worksheet::convertFromSceneUnits(m_line->pen().widthF(), Worksheet::Unit::Point) );
......
......@@ -562,9 +562,9 @@ void XYConvolutionCurveDock::showConvolutionResult() {
}
if (convolutionResult.elapsedTime > 1000)
str += i18n("calculation time: %1 s", QString::number(convolutionResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(convolutionResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(convolutionResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(convolutionResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -455,9 +455,9 @@ void XYCorrelationCurveDock::showCorrelationResult() {
}
if (correlationResult.elapsedTime > 1000)
str += i18n("calculation time: %1 s", QString::number(correlationResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(correlationResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(correlationResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(correlationResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -66,7 +66,7 @@ void XYDataReductionCurveDock::setupGeneral() {
m_leComment = uiGeneralTab.leComment;
auto* gridLayout = static_cast<QGridLayout*>(generalTab->layout());
gridLayout->setContentsMargins(2,2,2,2);
gridLayout->setContentsMargins(2, 2, 2, 2);
gridLayout->setHorizontalSpacing(2);
gridLayout->setVerticalSpacing(2);
......@@ -649,15 +649,15 @@ void XYDataReductionCurveDock::showDataReductionResult() {
}
if (dataReductionResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(dataReductionResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(dataReductionResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(dataReductionResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(dataReductionResult.elapsedTime)) + "<br>";
str += "<br>";
str += i18n("number of points: %1", QString::number(dataReductionResult.npoints)) + "<br>";
str += i18n("positional squared error: %1", QString::number(dataReductionResult.posError)) + "<br>";
str += i18n("area error: %1", QString::number(dataReductionResult.areaError)) + "<br>";
str += i18n("number of points: %1", QLocale().toString(static_cast<qulonglong>(dataReductionResult.npoints))) + "<br>";
str += i18n("positional squared error: %1", QLocale().toString(dataReductionResult.posError)) + "<br>";
str += i18n("area error: %1", QLocale().toString(dataReductionResult.areaError)) + "<br>";
uiGeneralTab.teResult->setText(str);
}
......
......@@ -66,7 +66,7 @@ void XYDifferentiationCurveDock::setupGeneral() {
m_leComment = uiGeneralTab.leComment;
auto* gridLayout = static_cast<QGridLayout*>(generalTab->layout());
gridLayout->setContentsMargins(2,2,2,2);
gridLayout->setContentsMargins(2, 2, 2, 2);
gridLayout->setHorizontalSpacing(2);
gridLayout->setVerticalSpacing(2);
......@@ -554,9 +554,9 @@ void XYDifferentiationCurveDock::showDifferentiationResult() {
}
if (differentiationResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(differentiationResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(differentiationResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(differentiationResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(differentiationResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -88,6 +88,7 @@ void XYFourierFilterCurveDock::setupGeneral() {
uiGeneralTab.cbUnit2->addItem(i18n(nsl_filter_cutoff_unit_name[i]));
}
//TODO: use line edits
uiGeneralTab.sbMin->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
uiGeneralTab.sbMax->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
......@@ -630,9 +631,9 @@ void XYFourierFilterCurveDock::showFilterResult() {
}
if (filterResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(filterResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(filterResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(filterResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(filterResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -79,6 +79,7 @@ void XYFourierTransformCurveDock::setupGeneral() {
for (int i = 0; i < NSL_DFT_XSCALE_COUNT; i++)
uiGeneralTab.cbXScale->addItem(i18n(nsl_dft_xscale_name[i]));
//TODO: use line edits
uiGeneralTab.sbMin->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
uiGeneralTab.sbMax->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
......@@ -361,9 +362,9 @@ void XYFourierTransformCurveDock::showTransformResult() {
}
if (transformResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(transformResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(transformResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(transformResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(transformResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -84,6 +84,7 @@ void XYIntegrationCurveDock::setupGeneral() {
for (int i = 0; i < NSL_INT_NETHOD_COUNT; i++)
uiGeneralTab.cbMethod->addItem(i18n(nsl_int_method_name[i]));
//TODO: use line edits
uiGeneralTab.sbMin->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
uiGeneralTab.sbMax->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
......@@ -471,11 +472,11 @@ void XYIntegrationCurveDock::showIntegrationResult() {
}
if (integrationResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(integrationResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(integrationResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(integrationResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(integrationResult.elapsedTime)) + "<br>";
str += i18n("value: %1", QString::number(integrationResult.value)) + "<br>";
str += i18n("value: %1", QLocale().toString(integrationResult.value)) + "<br>";
str += "<br><br>";
uiGeneralTab.teResult->setText(str);
......
......@@ -100,6 +100,7 @@ void XYInterpolationCurveDock::setupGeneral() {
uiGeneralTab.cbPointsMode->addItem(i18n("Multiple of data points"));
uiGeneralTab.cbPointsMode->addItem(i18n("Custom"));
//TODO: use line edits
uiGeneralTab.sbMin->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
uiGeneralTab.sbMax->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
......@@ -121,6 +122,7 @@ void XYInterpolationCurveDock::setupGeneral() {
connect(uiGeneralTab.dateTimeEditMax, &QDateTimeEdit::dateTimeChanged, this, &XYInterpolationCurveDock::xRangeMaxDateTimeChanged);
connect(uiGeneralTab.cbType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &XYInterpolationCurveDock::typeChanged);
connect(uiGeneralTab.cbVariant, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &XYInterpolationCurveDock::variantChanged);
//TODO: use line edits?
connect(uiGeneralTab.sbTension, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &XYInterpolationCurveDock::tensionChanged);
connect(uiGeneralTab.sbContinuity, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &XYInterpolationCurveDock::continuityChanged);
connect(uiGeneralTab.sbBias, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &XYInterpolationCurveDock::biasChanged);
......@@ -692,9 +694,9 @@ void XYInterpolationCurveDock::showInterpolationResult() {
}
if (interpolationResult.elapsedTime>1000)
str += i18n("calculation time: %1 s", QString::number(interpolationResult.elapsedTime/1000)) + "<br>";
str += i18n("calculation time: %1 s", QLocale().toString(interpolationResult.elapsedTime/1000)) + "<br>";
else
str += i18n("calculation time: %1 ms", QString::number(interpolationResult.elapsedTime)) + "<br>";
str += i18n("calculation time: %1 ms", QLocale().toString(interpolationResult.elapsedTime)) + "<br>";
str += "<br><br>";
......
......@@ -87,6 +87,7 @@ void XYSmoothCurveDock::setupGeneral() {
for (int i = 0; i < NSL_SMOOTH_PAD_MODE_COUNT; i++)
uiGeneralTab.cbMode->addItem(i18n(nsl_smooth_pad_mode_name[i]));
//TODO: use line edits
uiGeneralTab.sbMin->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
uiGeneralTab.sbMax->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
......@@ -107,6 +108,7 @@ void XYSmoothCurveDock::setupGeneral() {
connect(uiGeneralTab.dateTimeEditMin, &QDateTimeEdit::dateTimeChanged, this, &XYSmoothCurveDock::xRangeMinDateTimeChanged);
connect(uiGeneralTab.dateTimeEditMax, &QDateTimeEdit::dateTimeChanged, this, &XYSmoothCurveDock::xRangeMaxDateTimeChanged);
connect(uiGeneralTab.cbType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &XYSmoothCurveDock::typeChanged);
//TODO: line edits?
connect(uiGeneralTab.sbPoints, QOverload<int>::of(&QSpinBox::valueChanged), this, &XYSmoothCurveDock::pointsChanged);
connect(uiGeneralTab.cbWeight, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &XYSmoothCurveDock::weightChanged);
connect(uiGeneralTab.sbPercentile, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &XYSmoothCurveDock::percentileChanged);
......@@ -571,9 +573,9 @@ void XYSmoothCurveDock::showSmoothResult() {