[QWT] Edit legend icons size
Unsolved
3rd Party Software
-
Hi,
I would like to change size of icon in my QwtLegend. So I wrote something like this:
QwtPlotCurve* curve = new QwtPlotCurve(); ... curve->attach(this); QwtPlotLegendItem *lgdItem = dynamic_cast<QwtPlotLegendItem*>(legend->find(curve)); lgdItem->setLegendIconSize(QSize(15,15));
But I got error:
error: cannot initialize a parameter of type 'WId' (aka 'unsigned int') with an lvalue of type 'QwtPlotCurve *'
I saw in others examples this solution. I use this version of qwt: https://sourceforge.net/p/qwt/code/HEAD/tree/branches/qwt-6.1-multiaxes/
How could I change icons size?
-
Hi,
Which line of your code triggers this ?
Can you show the full code where it happens ? -
@SGaist unfortunately I can't show all the code. The problem is in function:
legend->find(curve)
-
-
@SGaist It's object of QwtLegend, defined in constructor of my own Plot
Chart::Chart(QWidget* parent) : QwtPlot(parent) { QwtLegend *legend = new QwtLegend(this); legend->setFont(QFont("Helvetica", 12)); insertLegend(legend, QwtPlot::BottomLegend); }