Good morning,
I have a very short question with a long explanation. So, here's the question:
So, here is my question: is it possible to change the alignment of a QwtSymbol used in a QwtPlotMarker? if not, is it possible to create a custom symbol (e.g. a polygon)?
I'm using a QwtPlotMarker with a symbol (DTriangle) to point on a curve:
Code:
marker->setLabelAlignment(Qt::AlignTop); marker->attach(plot);
I get the x/y-coordinates of the point I want to point on. But, if I set marker->setValue(x,y), the triangle is painted with x/y at it's center. I'd like to have it top-aligned, so that the lower corner is at (x,y). My first thought was: shift y by transformed size of the symbol:
Code:
marker->setValue(x, y+symbolHeight);
that works - until I zoom in or out. Then, the triangle is too high or too low. This is also clear: the fixed pixel size of the symbol was translated into yValues. When I zoom, the ratio pixel/values changes and so does the distance between marker pos and curve. I know, I could recalculate the marker's position each time I zoom, but maybe there's a better solution...
thanks!
Felix
