Hello,

I'm trying to include a legend with multiple columns on top of my plot, but only one ever appears.

Here's the code for adding a new data set (part of a member function of a class that inherits QwtPlot):

Qt Code:
  1. QwtPlotCurve* curve = new QwtPlotCurve(var->get_name());
  2. curve->attach(this);
  3. plotLayout()->setLegendPosition(QwtPlot::TopLegend);
To copy to clipboard, switch view to plain text mode 

but every time I add a curve, the legend gets a new item directly underneath the old one. I have no other legend-related code anywhere, and there is plenty of space for 2-3 more legend items before adding another row. I'm using Qwt-5.2.1.

How do I get legend items to appear in multiple columns above my plot?

Thanks,
Tom