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()
return colors[nextColorIndex++]; return colors[nextColorIndex++];
} }
QColor ChartPlot::getColorForCurve(QString id) QColor ChartPlot::getColorForCurve(const QString &id)
{ {
return curves.value(id)->pen().color(); return curves.value(id)->pen().color();
} }

2
src/ui/linechart/ChartPlot.h

@ -17,7 +17,7 @@ public:
QColor getNextColor(); QColor getNextColor();
/** @brief Get color for curve id */ /** @brief Get color for curve id */
QColor getColorForCurve(QString id); QColor getColorForCurve(const QString &id);
/** @brief Reset color map */ /** @brief Reset color map */
void shuffleColors(); void shuffleColors();

8
src/ui/linechart/IncrementalPlot.cc

@ -155,7 +155,7 @@ void IncrementalPlot::showLegend(bool show)
* *
* @param style Formatting string for line/data point style * @param style Formatting string for line/data point style
*/ */
void IncrementalPlot::setStyleText(QString style) void IncrementalPlot::setStyleText(const QString &style)
{ {
foreach (QwtPlotCurve* curve, curves) { foreach (QwtPlotCurve* curve, curves) {
// Style of datapoints // Style of datapoints
@ -250,12 +250,12 @@ void IncrementalPlot::updateScale()
zoomer->setZoomBase(true); 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); 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; CurveData* data;
QwtPlotCurve* curve; 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 * @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; int result = 0;
if (d_data.contains(key)) { if (d_data.contains(key)) {

8
src/ui/linechart/IncrementalPlot.h

@ -84,14 +84,14 @@ public:
bool gridEnabled(); bool gridEnabled();
/** @brief Read out data from a curve */ /** @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: public slots:
/** @brief Append one data point */ /** @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 */ /** @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 */ /** @brief Reset the plot scaling to the default value */
void resetScaling(); void resetScaling();
@ -109,7 +109,7 @@ public slots:
void showGrid(bool show); void showGrid(bool show);
/** @brief Set new plot style */ /** @brief Set new plot style */
void setStyleText(QString style); void setStyleText(const QString &style);
/** @brief Set symmetric axis scaling mode */ /** @brief Set symmetric axis scaling mode */
void setSymmetric(bool symmetric); void setSymmetric(bool symmetric);

Loading…
Cancel
Save