Sidebar in QwtLegend
-
Hallo,
ich have a QwtPlot and would like to have a QwtLegend which discripe the curves in my Plot.
If I insert the legend to my plot I get a scrollbar. How kann ich avoid this Scrollbar. I would like to have my legend in one Line without scrollbar.My code:
QwtLegend* legend = new QwtLegend;
legend->setDefaultItemMode(QwtLegendData::Checkable);
legend->setFrameStyle(QFrame::Box | QFrame::Sunken);
QPalette pal = legend->palette();
pal.setColor(QPalette::Window, Qt::white);
legend->setPalette(pal);
legend->setAutoFillBackground(true);
ui->plot0->insertLegend(legend, QwtPlot::LeftLegend);I hope erveryone can help me.
-
Does the scrollBar always appear? Just realized that the legend it attached to the plot and no separate widget in a layout.
It seems that it's a known issue. As soon as the legend text is larger than a given size, the scrollBar appears, even if it makes the plot look a bit ugly.Maybe this will help: