1 Attachment(s)
How to get same icon size in QwtLegendItem for each entry? (fixed width)
Hello,
i have a QwtLegendItem that shows attached Plots
and attached QwtPlotShapeItems. The have all different
width of the icon left of theier name in QwtLegendItem.
Attachment 11761
How can i realize, that all have the same icon (symbol) width in QwtLegendItem?
Thx
Re: How to get same icon size in QwtLegendItem for each entry? (fixed width)
What about using: shapeItem->setLegendIconSize( ... ) ?
Uwe
Re: How to get same icon size in QwtLegendItem for each entry? (fixed width)
I do that already for the shapeItem with QSize(18x10). The problem ist not the shapeItem,
the problems are the curveItems.
I tried that also for curveItem with no effect, the LegendIconSize of a curve doesn'nt change.
A curve without symbol has a small legendItcon and a curve with symbol has a much bigger symbol in width.
That is shown in the picture.
Stefan
PS: the main problem for curveItem is qwtUpdateLegendIconSize, that is a static method in QwtPlotCurve and can't be override.
Re: How to get same icon size in QwtLegendItem for each entry? (fixed width)
Quote:
PS: the main problem for curveItem is qwtUpdateLegendIconSize, that is a static method in QwtPlotCurve and can't be override.
Code:
{
...
virtual QwtGraphic legendIcon
( int index,
const QSizeF &size
) const {
extendedSize.setHeight( size.height() );
extendedSize.setWidth( ... );
}
};
Uwe
Re: How to get same icon size in QwtLegendItem for each entry? (fixed width)
Excellent Uwe !!! Exactly what i was looking for. :)
Thank You!