Peter Leopold | 28 Apr 16:30
Favicon

more on QwtPlotMarkers and the bode example

Uwe Rathmann wrote:
> On Wednesday 23 April 2008 22:34, Peter Leopold wrote:
> 
>> Has anyone had success labeling QwtPlots with QwtPlotMarkers, then
>> exporting the plots to pdf or a printer?
> 

> Yes, f.e the bode example does it.

In hindsight, I should have done this first:

>From the bode example, I've added the setLineStyle(),
setLabelAlignment(), setLinePen() aspects of plotmarkers.
I've created a memory leak in doing so, but it is the same
memory leak in the bode example, viz., allocating but
never deleting QwtPlotMarkers. The result is plottable,
pdf exportable plotmarker, but . . .

The bode example requires dashed or dotted lines in order for the
QwtPlotMarkers to be located in the correct places. If you turn off
these lines
    d_mrk1->setLineStyle(QwtPlotMarker::NoLine);

the markers move around on the plot. Strange. The pdf export contains
the mislocated markers.

In my case, if I set lineStyle to NoLine, the markers disappear from
the pdf files. They also move around on the screen plot.

Since I have 192 plotmarkers, I cannot tolerate 192 vertical/horizontal
lines.

Does anyone know how to turn this *@*#*$ lines off without sacrificing
the markers themselves?

I'm contemplating two workarounds:

1. QwtPlainTextEngine::draw(qpainter,QRect rect,int flags,QString text)
as a workaround. QwtPlot doesn't have a getPainter() method. What method
can I use to implement the QwtPlainTextEngine directly on the QwtPlot?
(I have the feeling that I'm asking how to recreate QwtPlotMarkers from
scratch.)

2. QClipBoard to do a screen capture then print to pdf.

Comments? Suggestions?

Peter (day 5 of the quest to print QwtPlotMarkers from the screen to the
pdf file)

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Gmane