Is there an easy way to scale the size of a QwtPlotMarker, that is a QwtSymbol? I'd like it scaled corresponding to my axes.
Thanks,
Joey
Is there an easy way to scale the size of a QwtPlotMarker, that is a QwtSymbol? I'd like it scaled corresponding to my axes.
Thanks,
Joey
Try one of the following:
- Enable the QwtPlotItem::ScaleInterest flag and overload QwtPlotItem::updateScaleDiv()
- Overload QwtPlotMarker::draw()
- Use QwtPlotShapeItem
Uwe
I thought I would try the QwtPlotShapeItem, and that worked great!
However, I wanted to attach a label to it as well. That API (setLabel) doesn't exist, so I thought I would create another QwtPlotShapeItem using addText of the QPainterPath. This sort of works. If I add a text, I have to set my point size to a large number (i.e. the size of the bounding rectangle) to see the text, but the text is also flipped! I notice none of the examples have a QwtPlotShapeItem with a text so maybe that was not supported? Or I'm missing something.
Anyway, I used a combination of QwtPlotShapeItem and QwtPlotMarker to do what I needed, so thank you for the help!
Joey
Bookmarks