Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
LabPlot
Commits
708a25d0
Commit
708a25d0
authored
Jul 04, 2020
by
Stefan Gerlach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[locale] matrix, etc. and analysis docks
parent
ef98d4d9
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
118 additions
and
96 deletions
+118
-96
src/backend/worksheet/plots/cartesian/XYCurve.cpp
src/backend/worksheet/plots/cartesian/XYCurve.cpp
+10
-14
src/kdefrontend/dockwidgets/CartesianPlotLegendDock.cpp
src/kdefrontend/dockwidgets/CartesianPlotLegendDock.cpp
+1
-1
src/kdefrontend/dockwidgets/CustomPointDock.cpp
src/kdefrontend/dockwidgets/CustomPointDock.cpp
+24
-18
src/kdefrontend/dockwidgets/MatrixDock.cpp
src/kdefrontend/dockwidgets/MatrixDock.cpp
+41
-29
src/kdefrontend/dockwidgets/ReferenceLineDock.cpp
src/kdefrontend/dockwidgets/ReferenceLineDock.cpp
+11
-10
src/kdefrontend/dockwidgets/XYConvolutionCurveDock.cpp
src/kdefrontend/dockwidgets/XYConvolutionCurveDock.cpp
+2
-2
src/kdefrontend/dockwidgets/XYCorrelationCurveDock.cpp
src/kdefrontend/dockwidgets/XYCorrelationCurveDock.cpp
+2
-2
src/kdefrontend/dockwidgets/XYDataReductionCurveDock.cpp
src/kdefrontend/dockwidgets/XYDataReductionCurveDock.cpp
+6
-6
src/kdefrontend/dockwidgets/XYDifferentiationCurveDock.cpp
src/kdefrontend/dockwidgets/XYDifferentiationCurveDock.cpp
+3
-3
src/kdefrontend/dockwidgets/XYFourierFilterCurveDock.cpp
src/kdefrontend/dockwidgets/XYFourierFilterCurveDock.cpp
+3
-2
src/kdefrontend/dockwidgets/XYFourierTransformCurveDock.cpp
src/kdefrontend/dockwidgets/XYFourierTransformCurveDock.cpp
+3
-2
src/kdefrontend/dockwidgets/XYIntegrationCurveDock.cpp
src/kdefrontend/dockwidgets/XYIntegrationCurveDock.cpp
+4
-3
src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp
src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp
+4
-2
src/kdefrontend/dockwidgets/XYSmoothCurveDock.cpp
src/kdefrontend/dockwidgets/XYSmoothCurveDock.cpp
+4
-2
No files found.
src/backend/worksheet/plots/cartesian/XYCurve.cpp
View file @
708a25d0
...
...
@@ -1771,7 +1771,7 @@ void XYCurvePrivate::updateValues() {
if
(
!
m_pointVisible
.
at
(
i
++
))
continue
;
QString
value
;
if
(
rangeFormat
==
CartesianPlot
::
RangeFormat
::
Numeric
)
value
=
Q
String
::
number
(
point
.
x
(),
valuesNumericFormat
,
precision
);
value
=
Q
Locale
().
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
=
Q
String
::
number
(
point
.
y
(),
valuesNumericFormat
,
precision
);
value
=
Q
Locale
().
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
+=
Q
String
::
number
(
point
.
x
(),
valuesNumericFormat
,
xPrecision
);
value
+=
Q
Locale
().
toString
(
point
.
x
(),
valuesNumericFormat
,
xPrecision
);
else
value
+=
QDateTime
::
fromMSecsSinceEpoch
(
point
.
x
()).
toString
(
valuesDateTimeFormat
);
if
(
yRangeFormat
==
CartesianPlot
::
RangeFormat
::
Numeric
)
value
+=
','
+
Q
String
::
number
(
point
.
y
(),
valuesNumericFormat
,
yPrecision
);
value
+=
','
+
Q
Locale
().
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
+
Q
String
::
number
(
valuesColumn
->
valueAt
(
i
),
valuesNumericFormat
,
valuesPrecision
)
+
valuesSuffix
;
m_valueStrings
<<
valuesPrefix
+
Q
Locale
().
toString
(
valuesColumn
->
valueAt
(
i
),
valuesNumericFormat
,
valuesPrecision
)
+
valuesSuffix
;
break
;
case
AbstractColumn
::
ColumnMode
::
Integer
:
case
AbstractColumn
::
ColumnMode
::
BigInt
:
m_valueStrings
<<
valuesPrefix
+
Q
String
::
number
(
valuesColumn
->
valueAt
(
i
))
+
valuesSuffix
;
m_valueStrings
<<
valuesPrefix
+
Q
Locale
().
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
);
...
...
src/kdefrontend/dockwidgets/CartesianPlotLegendDock.cpp
View file @
708a25d0
...
...
@@ -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
...
...
src/kdefrontend/dockwidgets/CustomPointDock.cpp
View file @
708a25d0
...
...
@@ -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
(
Q
String
::
number
(
position
.
x
()));
ui
.
lePositionY
->
setText
(
Q
String
::
number
(
position
.
y
()));
ui
.
lePositionX
->
setText
(
Q
Locale
().
toString
(
position
.
x
()));
ui
.
lePositionY
->
setText
(
Q
Locale
().
toString
(
position
.
y
()));
m_initializing
=
false
;
}
...
...
@@ -420,8 +426,8 @@ void CustomPointDock::load() {
m_initializing
=
true
;
ui
.
lePositionX
->
setText
(
Q
String
::
number
(
m_point
->
position
().
x
()));
ui
.
lePositionY
->
setText
(
Q
String
::
number
(
m_point
->
position
().
y
()));
ui
.
lePositionX
->
setText
(
Q
Locale
().
toString
(
m_point
->
position
().
x
()));
ui
.
lePositionY
->
setText
(
Q
Locale
().
toString
(
m_point
->
position
().
y
()));
ui
.
cbSymbolStyle
->
setCurrentIndex
(
(
int
)
m_point
->
symbolStyle
()
);
ui
.
sbSymbolSize
->
setValue
(
Worksheet
::
convertFromSceneUnits
(
m_point
->
symbolSize
(),
Worksheet
::
Unit
::
Point
)
);
...
...
src/kdefrontend/dockwidgets/MatrixDock.cpp
View file @
708a25d0
...
...
@@ -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 th
e
one matrix
//disable the
se
fields if there
is
more th
an
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
(
Q
String
::
number
(
value
));
ui
.
leXStart
->
setText
(
Q
Locale
().
toString
(
value
));
m_initializing
=
false
;
}
void
MatrixDock
::
matrixXEndChanged
(
double
value
)
{
m_initializing
=
true
;
ui
.
leXEnd
->
setText
(
Q
String
::
number
(
value
));
ui
.
leXEnd
->
setText
(
Q
Locale
().
toString
(
value
));
m_initializing
=
false
;
}
void
MatrixDock
::
matrixYStartChanged
(
double
value
)
{
m_initializing
=
true
;
ui
.
leYStart
->
setText
(
Q
String
::
number
(
value
));
ui
.
leYStart
->
setText
(
Q
Locale
().
toString
(
value
));
m_initializing
=
false
;
}
void
MatrixDock
::
matrixYEndChanged
(
double
value
)
{
m_initializing
=
true
;
ui
.
leYEnd
->
setText
(
Q
String
::
number
(
value
));
ui
.
leYEnd
->
setText
(
Q
Locale
().
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
(
Q
String
::
number
(
m_matrix
->
xStart
()));
ui
.
leXEnd
->
setText
(
Q
String
::
number
(
m_matrix
->
xEnd
()));
ui
.
leYStart
->
setText
(
Q
String
::
number
(
m_matrix
->
yStart
()));
ui
.
leYEnd
->
setText
(
Q
String
::
number
(
m_matrix
->
yEnd
()));
ui
.
leXStart
->
setText
(
Q
Locale
().
toString
(
m_matrix
->
xStart
()));
ui
.
leXEnd
->
setText
(
Q
Locale
().
toString
(
m_matrix
->
xEnd
()));
ui
.
leYStart
->
setText
(
Q
Locale
().
toString
(
m_matrix
->
yStart
()));
ui
.
leYEnd
->
setText
(
Q
Locale
().
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
(
Q
String
::
number
(
group
.
readEntry
(
"XStart"
,
m_matrix
->
xStart
()))
);
ui
.
leXEnd
->
setText
(
Q
String
::
number
(
group
.
readEntry
(
"XEnd"
,
m_matrix
->
xEnd
()))
);
ui
.
leYStart
->
setText
(
Q
String
::
number
(
group
.
readEntry
(
"YStart"
,
m_matrix
->
yStart
()))
);
ui
.
leYEnd
->
setText
(
Q
String
::
number
(
group
.
readEntry
(
"YEnd"
,
m_matrix
->
yEnd
()))
);
ui
.
leXStart
->
setText
(
Q
Locale
().
toString
(
group
.
readEntry
(
"XStart"
,
m_matrix
->
xStart
()))
);
ui
.
leXEnd
->
setText
(
Q
Locale
().
toString
(
group
.
readEntry
(
"XEnd"
,
m_matrix
->
xEnd
()))
);
ui
.
leYStart
->
setText
(
Q
Locale
().
toString
(
group
.
readEntry
(
"YStart"
,
m_matrix
->
yStart
()))
);
ui
.
leYEnd
->
setText
(
Q
Locale
().
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
()));
...
...
src/kdefrontend/dockwidgets/ReferenceLineDock.cpp
View file @
708a25d0
...
...
@@ -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
(
Q
String
::
number
(
m_line
->
position
()));
ui
.
lePosition
->
setText
(
Q
Locale
().
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
)
);
...
...
src/kdefrontend/dockwidgets/XYConvolutionCurveDock.cpp
View file @
708a25d0
...
...
@@ -562,9 +562,9 @@ void XYConvolutionCurveDock::showConvolutionResult() {
}
if
(
convolutionResult
.
elapsedTime
>
1000
)
str
+=
i18n
(
"calculation time: %1 s"
,
Q
String
::
number
(
convolutionResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
convolutionResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
convolutionResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
convolutionResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYCorrelationCurveDock.cpp
View file @
708a25d0
...
...
@@ -455,9 +455,9 @@ void XYCorrelationCurveDock::showCorrelationResult() {
}
if
(
correlationResult
.
elapsedTime
>
1000
)
str
+=
i18n
(
"calculation time: %1 s"
,
Q
String
::
number
(
correlationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
correlationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
correlationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
correlationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYDataReductionCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
dataReductionResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
dataReductionResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
dataReductionResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
dataReductionResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br>"
;
str
+=
i18n
(
"number of points: %1"
,
Q
String
::
number
(
dataReductionResult
.
npoints
))
+
"<br>"
;
str
+=
i18n
(
"positional squared error: %1"
,
Q
String
::
number
(
dataReductionResult
.
posError
))
+
"<br>"
;
str
+=
i18n
(
"area error: %1"
,
Q
String
::
number
(
dataReductionResult
.
areaError
))
+
"<br>"
;
str
+=
i18n
(
"number of points: %1"
,
Q
Locale
().
toString
(
static_cast
<
qulonglong
>
(
dataReductionResult
.
npoints
))
)
+
"<br>"
;
str
+=
i18n
(
"positional squared error: %1"
,
Q
Locale
().
toString
(
dataReductionResult
.
posError
))
+
"<br>"
;
str
+=
i18n
(
"area error: %1"
,
Q
Locale
().
toString
(
dataReductionResult
.
areaError
))
+
"<br>"
;
uiGeneralTab
.
teResult
->
setText
(
str
);
}
...
...
src/kdefrontend/dockwidgets/XYDifferentiationCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
differentiationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
differentiationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
differentiationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
differentiationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYFourierFilterCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
filterResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
filterResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
filterResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
filterResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYFourierTransformCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
transformResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
transformResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
transformResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
transformResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYIntegrationCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
integrationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
integrationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
integrationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
integrationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"value: %1"
,
Q
String
::
number
(
integrationResult
.
value
))
+
"<br>"
;
str
+=
i18n
(
"value: %1"
,
Q
Locale
().
toString
(
integrationResult
.
value
))
+
"<br>"
;
str
+=
"<br><br>"
;
uiGeneralTab
.
teResult
->
setText
(
str
);
...
...
src/kdefrontend/dockwidgets/XYInterpolationCurveDock.cpp
View file @
708a25d0
...
...
@@ -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"
,
Q
String
::
number
(
interpolationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 s"
,
Q
Locale
().
toString
(
interpolationResult
.
elapsedTime
/
1000
))
+
"<br>"
;
else
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
String
::
number
(
interpolationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
i18n
(
"calculation time: %1 ms"
,
Q
Locale
().
toString
(
interpolationResult
.
elapsedTime
))
+
"<br>"
;
str
+=
"<br><br>"
;
...
...
src/kdefrontend/dockwidgets/XYSmoothCurveDock.cpp
View file @
708a25d0
...
...
@@ -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() {