Well if your question is about this particular text you can simply set the shorter string as curve title.
A more general solution is to overload QwtPlotItem::updateLegend():
void YourCurve
::updateLegend( QwtLegend *legend
) const {
if ( legend == NULL )
return;
QwtLegendItem *label
= qobject_cast<QwtLegendItem
*>
( legend
->find
( this ) );
if ( label )
{
...
label->setText( ... );
}
}
void YourCurve::updateLegend( QwtLegend *legend ) const
{
if ( legend == NULL )
return;
QwtPlotCurve::updateLegend( legend );
QwtLegendItem *label = qobject_cast<QwtLegendItem *>( legend->find( this ) );
if ( label )
{
QwtText text = title();
...
label->setText( ... );
}
}
To copy to clipboard, switch view to plain text mode
Unfortunately there is no support for Qt::TextElideMode in the Qwt layout system yet,
Uwe
Bookmarks