Skip to content

Commit

Permalink
There are two overloads for QStringList and QVector<QString> (#3977)
Browse files Browse the repository at this point in the history
These are not required in Qt6, as QStringList is an QVector<QString>
  • Loading branch information
andreasbuhr committed Jan 11, 2024
1 parent 408709c commit 466bdf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Charts/GenericChart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ GenericChart::addCurve(QString name, QVector<double> xseries, QVector<double> ys
return true;
}

#if QT_VERSION < 0x060000
// In Qt 6, QStringList is a QVector<QString>, so we don't need an additional overload
// helper for python - no aggregateby, no annotations
bool
GenericChart::addCurve(QString name, QVector<double> xseries, QVector<double> yseries, QStringList fseries, QString xname, QString yname,
Expand All @@ -163,6 +165,7 @@ GenericChart::addCurve(QString name, QVector<double> xseries, QVector<double> ys
opengl, legend, datalabels, fill, RideMetric::Average, QList<GenericAnnotationInfo>());
return true;
}
#endif

// configure axis, after curves added
bool
Expand Down
4 changes: 4 additions & 0 deletions src/Charts/GenericChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,14 @@ class GenericChart : public QWidget {
int line, int symbol, int size, QString color, int opacity, bool opengl, bool legend, bool datalabels,
bool fill, RideMetric::MetricType mtype, QList<GenericAnnotationInfo>annotations);

#if QT_VERSION < 0x060000
// In Qt 6, QStringList is a QVector<QString>, so we don't need an additional overload

// helper for Python and R charts fseries is a stringlist
bool addCurve(QString name, QVector<double> xseries, QVector<double> yseries, QStringList fseries, QString xname, QString yname,
QStringList labels, QStringList colors,
int line, int symbol, int size, QString color, int opacity, bool opengl, bool legend, bool datalabels, bool fill);
#endif

// configure axis, after curves added
bool configureAxis(QString name, bool visible, int align, double min, double max,
Expand Down

0 comments on commit 466bdf1

Please sign in to comment.