QwtPlotCurve is designed to display a unique type of symbol for all points. If you want to change this you need to reimplement drawSymbols:
virtual void YourPlotCurve
::drawSymbols(QPainter *painter,
int from, int to) const
{
for (int i = from; i <= to; i++)
{
const int xi = xMap.transform(x(i));
const int yi = yMap.transform(y(i));
rect.
moveCenter(QPoint(xi, yi
));
// now assign your individual properties
// ...
yourSymbol.draw(painter, rect);
}
}
virtual void YourPlotCurve::drawSymbols(QPainter *painter,
const QwtSymbol &symbol,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
int from, int to) const
{
for (int i = from; i <= to; i++)
{
const int xi = xMap.transform(x(i));
const int yi = yMap.transform(y(i));
rect.moveCenter(QPoint(xi, yi));
QwtSymbol yourSymbol = symbol:
// now assign your individual properties
// ...
yourSymbol.draw(painter, rect);
}
}
To copy to clipboard, switch view to plain text mode
If you need the PaintFiltered mode the code is more complicated, see qwt_plot_curve.cpp.
Note, that Qwt is open source and you can always look at the implementation of QwtPlotCurve to see what hooks are available and how they play together.
Uwe
Bookmarks