Browse Source

Change QString function parameters to const QString &

QGC4.4
John Tapsell 12 years ago
parent
commit
b0d4abacd4
  1. 2
      src/ui/linechart/ChartPlot.cc
  2. 2
      src/ui/linechart/ChartPlot.h
  3. 8
      src/ui/linechart/IncrementalPlot.cc
  4. 8
      src/ui/linechart/IncrementalPlot.h

2
src/ui/linechart/ChartPlot.cc

@ -70,7 +70,7 @@ QColor ChartPlot::getNextColor() @@ -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();
}

2
src/ui/linechart/ChartPlot.h

@ -17,7 +17,7 @@ public: @@ -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();

8
src/ui/linechart/IncrementalPlot.cc

@ -155,7 +155,7 @@ void IncrementalPlot::showLegend(bool show) @@ -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() @@ -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) @@ -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)) {

8
src/ui/linechart/IncrementalPlot.h

@ -84,14 +84,14 @@ public: @@ -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: @@ -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);

Loading…
Cancel
Save