bugfixed QSet-initialization

This commit is contained in:
jkriege2 2023-03-23 14:53:23 +01:00
parent 848ec1952a
commit fc642b6cac
2 changed files with 9 additions and 2 deletions

View File

@ -131,5 +131,6 @@ If we set seondary axes for the x-axis instead of the y-axis, i.e. use
// ... // ...
``` ```
we get a plot like this: we get a plot like this:
![second_axis_hor](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/second_axis_hor.png) ![second_axis_hor](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/second_axis_hor.png)

View File

@ -3337,14 +3337,20 @@ bool JKQTBasePlotter::hasYAxis(JKQTPCoordinateAxisRef axis) const
QSet<JKQTPCoordinateAxisRef> JKQTBasePlotter::getAvailableXAxisRefs(bool includePrimary) const QSet<JKQTPCoordinateAxisRef> JKQTBasePlotter::getAvailableXAxisRefs(bool includePrimary) const
{ {
QSet<JKQTPCoordinateAxisRef> res(secondaryXAxis.keyBegin(),secondaryXAxis.keyEnd()); QSet<JKQTPCoordinateAxisRef> res;
for (auto it=secondaryXAxis.begin(); it!=secondaryXAxis.end(); ++it) {
res.insert(it.key());
}
if (includePrimary) res.insert(JKQTPPrimaryAxis); if (includePrimary) res.insert(JKQTPPrimaryAxis);
return res; return res;
} }
QSet<JKQTPCoordinateAxisRef> JKQTBasePlotter::getAvailableYAxisRefs(bool includePrimary) const QSet<JKQTPCoordinateAxisRef> JKQTBasePlotter::getAvailableYAxisRefs(bool includePrimary) const
{ {
QSet<JKQTPCoordinateAxisRef> res(secondaryYAxis.keyBegin(),secondaryYAxis.keyEnd()); QSet<JKQTPCoordinateAxisRef> res;
for (auto it=secondaryYAxis.begin(); it!=secondaryYAxis.end(); ++it) {
res.insert(it.key());
}
if (includePrimary) res.insert(JKQTPPrimaryAxis); if (includePrimary) res.insert(JKQTPPrimaryAxis);
return res; return res;
} }