Results 1 to 6 of 6

Thread: QwtPlotRenderer doesn't render QwtScaleWidget axis

  1. #1
    Join Date
    Feb 2012
    Location
    Bologna
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy QwtPlotRenderer doesn't render QwtScaleWidget axis

    Hi all,

    I'd like to create a pdf document of my plot (QwtPlot)

    QwtPlotRenderer* plotRender = new QwtPlotRenderer();
    plotRender->setDiscardFlag(QwtPlotRenderer:iscardBackground,true);
    plotRender->setDiscardFlag(QwtPlotRenderer:iscardCanvasBackground,true);
    plotRender->setDiscardFlag(QwtPlotRenderer:iscardLegend,false);
    plotRender->setDiscardFlag(QwtPlotRenderer:iscardTitle,false);
    plotRender->setLayoutFlag(QwtPlotRenderer::FrameWithScales,tr ue);
    plotRender->setLayoutFlag(QwtPlotRenderer::KeepFrames,true) ;
    plotRender->setLayoutFlag(QwtPlotRenderer::KeepMargins,true );

    plotRender->renderDocument(plot,"F:/pippo.pdf","pdf",QSizeF(100,150),150);

    This code desn't render the axis of the plot!
    the axis are defined in the following way:

    axis y
    // A color bar on the right axis
    QwtScaleWidget colorAxis;

    colorAxis = axisWidget(QwtPlot::yLeft);
    colorAxis->setColorBarEnabled(true);
    colorAxis->setColorMap( zInterval, new ColorMap());
    colorAxis->setMinBorderDist(10,6);
    enableAxis(QwtPlot::yLeft,true);

    axis x
    QwtScaleWidget *bottomAxis;

    enableAxis(QwtPlot::xBottom,true);
    bottomAxis = axisWidget(QwtPlot::xBottom);
    QTime time;
    setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw(time));
    setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);


    this is the result:
    pippo.pdf

    can you help me?

    thanks cla

  2. #2
    Join Date
    Feb 2012
    Location
    Bologna
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlotRenderer doesn't render QwtScaleWidget axis

    why doesn't anybody reply to me ??

    Is it a so simple query or is it impossible??
    thanks cla

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,253
    Thanked 860 Times in 809 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotRenderer doesn't render QwtScaleWidget axis

    Compare your code with the spectrogram example - but at least QwtPlotRenderer::FrameWithScales doesn't make much sense in combination with a color bar.

    Uwe

  4. #4
    Join Date
    Feb 2012
    Location
    Bologna
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlotRenderer doesn't render QwtScaleWidget axis

    I Uwe,
    thanks a lot for your reply ..

    My code is based on the spectrogram example.. and about axis i don't find important differences...
    I haven't any problem with axis and plot on screen, but only to print...

    I tried whit a simple:
    QwtPlotRenderer renderer;
    renderer.renderDocument(this,"F:/pippo.pdf","pdf",QSizeF(300,250));
    with default setting.. but the result is the same.

    If you have some idea, please suggest me..
    I hope to find the way to render my plot with axis as soon as, and I 'll write here the solution..

    thanks
    Claudia

    I used QwtPlotRenderer::FrameWithScales only to try something because I don't understand ...

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,253
    Thanked 860 Times in 809 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotRenderer doesn't render QwtScaleWidget axis

    Qt Code:
    1. QwtPlotRenderer renderer;
    2. renderer.renderDocument(this,"pippo.pdf","pdf",QSizeF(300,250));
    To copy to clipboard, switch view to plain text mode 
    Testing this code with the spectrogram example ( code in Plot::printPlot replaced ) on my linux box - Qt 4.8.0 + Qwt from 6.0 SVN branch - everything works like expected.

    I'm afraid you have to post some compilable demo code demonstrating the problem.

    Uwe

  6. #6
    Join Date
    Feb 2012
    Location
    Bologna
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlotRenderer doesn't render QwtScaleWidget axis

    I Uwe..

    Trying to resolve my problem, I rebuild qwt... and my application starts to crash..
    Usually I don't off my pc.. I suspend it..
    This mornig my windows has had several problems, so I have to restart it!
    After all was ok!!!!!!! also the pdf with scalewidget .....

    It's possibile??? I'm crazy???
    I'm confused because I did not undestand what was the problem!!!
    So, I thank you and I hope my next question will be better!

Similar Threads

  1. Possible bug in QwtPlotRenderer
    By BettaUseYoNikes in forum Qwt
    Replies: 1
    Last Post: 29th November 2011, 09:00
  2. QwtPlotRenderer and ExternalLegend position
    By frankiefrank in forum Qwt
    Replies: 3
    Last Post: 29th November 2011, 08:53
  3. QGLWidget render or QGraphicsView with GL viewport render
    By QTInfinity in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2011, 12:34
  4. Replies: 1
    Last Post: 14th April 2011, 00:11
  5. Problems with QwtPlotRenderer from Qwt 6
    By mariposa in forum Qwt
    Replies: 24
    Last Post: 6th October 2010, 14:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.