diff --git a/src/ui/linechart/ChartPlot.cc b/src/ui/linechart/ChartPlot.cc index 665ff5233674f633c6cf324359ae4681020c9620..a1741f85cfb8df5c7a1bf7f9506d75a12ec7e1cf 100644 --- a/src/ui/linechart/ChartPlot.cc +++ b/src/ui/linechart/ChartPlot.cc @@ -70,7 +70,7 @@ QColor ChartPlot::getNextColor() return colors[nextColorIndex++]; } -QColor ChartPlot::getColorForCurve(QString id) +QColor ChartPlot::getColorForCurve(const QString &id) { return curves.value(id)->pen().color(); } diff --git a/src/ui/linechart/ChartPlot.h b/src/ui/linechart/ChartPlot.h index 74a232039ed2ca9bf9be9c2e09a51cd7d0d13c6c..c5196ae8b506e3ba2cbd7efd8d3b32e80bd75c8b 100644 --- a/src/ui/linechart/ChartPlot.h +++ b/src/ui/linechart/ChartPlot.h @@ -17,7 +17,7 @@ public: QColor getNextColor(); /** @brief Get color for curve id */ - QColor getColorForCurve(QString id); + QColor getColorForCurve(const QString &id); /** @brief Reset color map */ void shuffleColors(); diff --git a/src/ui/linechart/IncrementalPlot.cc b/src/ui/linechart/IncrementalPlot.cc index d227105c4978e76e162b424b175fa49ee600853a..6a5e13f4de9c553cc2cec6266e2055f049c54ef0 100644 --- a/src/ui/linechart/IncrementalPlot.cc +++ b/src/ui/linechart/IncrementalPlot.cc @@ -155,7 +155,7 @@ void IncrementalPlot::showLegend(bool show) * * @param style Formatting string for line/data point style */ -void IncrementalPlot::setStyleText(QString style) +void IncrementalPlot::setStyleText(const QString &style) { foreach (QwtPlotCurve* curve, curves) { // Style of datapoints @@ -250,12 +250,12 @@ void IncrementalPlot::updateScale() zoomer->setZoomBase(true); } -void IncrementalPlot::appendData(QString key, double x, double y) +void IncrementalPlot::appendData(const QString &key, double x, double y) { appendData(key, &x, &y, 1); } -void IncrementalPlot::appendData(QString key, double *x, double *y, int size) +void IncrementalPlot::appendData(const QString &key, double *x, double *y, int size) { CurveData* data; QwtPlotCurve* curve; @@ -349,7 +349,7 @@ void IncrementalPlot::appendData(QString key, double *x, double *y, int size) /** * @return Number of copied data points, 0 on failure */ -int IncrementalPlot::data(QString key, double* r_x, double* r_y, int maxSize) +int IncrementalPlot::data(const QString &key, double* r_x, double* r_y, int maxSize) { int result = 0; if (d_data.contains(key)) { diff --git a/src/ui/linechart/IncrementalPlot.h b/src/ui/linechart/IncrementalPlot.h index 06dee02ff04e90449343b0392e326d39ecc81c84..0b7f2d3b4f3a381cbfcb13e4c9e0a67561ab223f 100644 --- a/src/ui/linechart/IncrementalPlot.h +++ b/src/ui/linechart/IncrementalPlot.h @@ -84,14 +84,14 @@ public: bool gridEnabled(); /** @brief Read out data from a curve */ - int data(QString key, double* r_x, double* r_y, int maxSize); + int data(const QString &key, double* r_x, double* r_y, int maxSize); public slots: /** @brief Append one data point */ - void appendData(QString key, double x, double y); + void appendData(const QString &key, double x, double y); /** @brief Append multiple data points */ - void appendData(QString key, double* x, double* y, int size); + void appendData(const QString &key, double* x, double* y, int size); /** @brief Reset the plot scaling to the default value */ void resetScaling(); @@ -109,7 +109,7 @@ public slots: void showGrid(bool show); /** @brief Set new plot style */ - void setStyleText(QString style); + void setStyleText(const QString &style); /** @brief Set symmetric axis scaling mode */ void setSymmetric(bool symmetric);