PDA

View Full Version : Labeling a curve



kalgorithmist
10th May 2011, 17:49
Hi,

I am new to Qt and Qwt. I want to set a label or a title for the plotted curve. I tried setting something like this:


QwtPlotCurve curve;

curve.setTitle("some curve");

but "some curve" is not shown.

Any ideas?

many thanks.

mvuori
10th May 2011, 18:37
I don't know anything about Qwt, but out of curiosity I checked what http://qwt.sourceforge.net/class_qwt_plot_curve.html says about it and that page doesn't know setTitle, but implies that the title is given as constructor argument: QwtPlotCurve::QwtPlotCurve ( const QString & title = QString::null)

Uwe
10th May 2011, 21:06
... but "some curve" is not shown.
Wow this code is really optimistic ...

All plot items need to be allocated by new and attached to the plot widget. Then the title might be displayed on the legend of the plot widget - when you have defined one.

Better check the examples first ...

Uwe