Results 1 to 13 of 13

Thread: Qwt 5.1 + Qt 4.5 - SVG no clipping

  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qwt 5.1 + Qt 4.5 - SVG no clipping

    I am trying to export a picture in svg format.
    With Qwt 5.1 and Qt 4.4 all worked fine.
    But now, if I use Qt 4.5.0 I have a plot outside the clipping region, like in the figure.
    All clippings are set in the QwtPlotCurve.
    Any idea ?
    The code is quite standard

    Qt Code:
    1. void MyPlot::exportSVG()
    2. {
    3. QString fileName;
    4.  
    5.  
    6. fileName = QFileDialog::getSaveFileName(this, tr("Nome file da esportare"), recentExportPath,"Graphic files ( *svg)");
    7.  
    8.  
    9. if ( !fileName.isEmpty() )
    10. {
    11. fileName = MyMath::checkFormat(fileName,"svg");
    12. QSvgGenerator generator;
    13. generator.setFileName(fileName);
    14. generator.setSize(QSize(1024, 800));
    15. int options = QwtPlotPrintFilter::PrintAll;
    16. options |= QwtPlotPrintFilter::PrintBackground;
    17. options |= QwtPlotPrintFilter::PrintFrameWithScales|QwtPlotPrintFilter::PrintMargin;
    18. filter.setOptions(options);
    19.  
    20.  
    21. print(generator,filter);
    22. }
    To copy to clipboard, switch view to plain text mode 
    I tried also qwt 5.2 + qt4.5, but a segfault error happens.
    G
    Attached Images Attached Images

  2. #2
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    ...in particuluar the seg fault (Qwt 5.2 + Qt 4.5) is as follows:

    #0 0x00b7c3d3 in main_arena () from /lib/libc.so.6
    #1 0x00c893f2 in QwtPlotCurve::setRawData () from /usr/lib/libqwt.so.5
    #2 0x08058520 in MyPlot::drawMyContents ()

  3. #3
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    NO replies?
    I tried any combination for my software and the results are as follows:
    (I did not touch the code of my software)

    Qt Qwt Problems
    --------------------------------------------------
    4.5 5.1 Run, but exporting in SVG, clips are not correct
    4.5 5.2 Not run: strange segfault when calling setRawData()
    4.4 5.1 Run, but exporting in SVG, clips are not correct
    4.4 5.2 Run, but strange segfault when calling setRawData()

    So, it seems that 5.2 has some problems, hasn't it?

  4. #4
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    I discovered that alos under linuk,
    the examples of qwt-5-2 do not run either.
    Same segfault as above!!!

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

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    The Qt SVG paint engine doesn't support clipping at all. So there is no chance that clippings set for a QPainter will work.

    For SVG rendering Qwt 5.2 does some clipping against the borders of the canvas. It should work for the common plot items, but not more.

    Uwe

    PS: The crashes are a problem on your side

  6. #6
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    I think they do not, because my software worked fine (as I explained in the previous post).
    I just downloaded qwt 5.2, installed and compiled. No ticks, no changes.

  7. #7
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    Quote Originally Posted by Uwe View Post

    For SVG rendering Qwt 5.2 does some clipping against the borders of the canvas. It should work for the common plot items, but not more.
    So, you mean that I can't export an SVG picture of my plot (like in the attachment)?

  8. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    As long as you didn't implement any individual plot item ( that doesn't clip on its own ) you should have no problem with Qwt 5.2.
    Fix your Qwt 5.2 build/installation ( or your code, when it is the reason for the crash ) and your SVG document will be o.k.

    Uwe

  9. #9
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    Ok, now, strangley, Qwt-5.2 runs with Qt 4.5.0, but
    still I cannot obtain my svg picture correct. (see the attach)

    Qt Code:
    1. void MyPlot::exportSVG()
    2. {
    3. QString fileName;
    4.  
    5.  
    6. fileName = QFileDialog::getSaveFileName(this, tr("Nome file da esportare"), recentExportPath,"Graphic files ( *svg)");
    7.  
    8. QFileInfo fileInfo(fileName);
    9. recentExportPath = fileInfo.absoluteDir().absolutePath();
    10.  
    11. if ( !fileName.isEmpty() )
    12. {
    13. fileName = MyMath::checkFormat(fileName,"svg");
    14. QSvgGenerator generator;
    15. generator.setFileName(fileName);
    16. generator.setSize(QSize(1024, 800));
    17. int options = QwtPlotPrintFilter::PrintAll;
    18. options |= ~QwtPlotPrintFilter::PrintBackground;
    19. options |= QwtPlotPrintFilter::PrintFrameWithScales|QwtPlotPrintFilter::PrintMargin;
    20. filter.setOptions(options);
    21.  
    22.  
    23. print(generator,filter);
    24. }
    25.  
    26.  
    27. }
    To copy to clipboard, switch view to plain text mode 
    On the screen, everything is fine. My plot data are also negative, but I do not understand why the SVG printing catches alsot those negative data, while other exporting like PNG does not.
    Attached Images Attached Images

  10. #10
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    Now, again I have the same seg fault.
    I did not change anything . The segfault happens only with qwt-5.2.
    This is a gdb output

    Qt Code:
    1. Program received signal SIGSEGV, Segmentation fault.
    2. 0x00c84073 in QwtPlot::legendItemChecked () from /usr/lib/libqwt.so.5
    3. Missing separate debuginfos, use: debuginfo-install OpenEXR-libs-1.6.1-4.fc10.i386 bzip2-libs-1.0.5-3.fc10.i386 dbus-libs-1.2.4-2.fc10.i386 e2fsprogs-libs-1.41.4-1.fc10.i386 expat-2.0.1-5.i386 fontconfig-2.6.0-3.fc10.i386 freetype-2.3.7-2.fc10.i386 glib2-2.18.4-1.fc10.i386 glibc-2.9-3.i686 ilmbase-1.0.1-2.fc9.i386 jasper-libs-1.900.1-9.fc10.i386 kdebase-runtime-libs-4.2.1-2.fc10.i386 kdelibs-4.2.1-4.fc10.i386 lcms-libs-1.17-6.fc10.i386 libICE-1.0.4-4.fc10.i386 libSM-1.1.0-2.fc10.i386 libX11-1.1.4-6.fc10.i386 libXau-1.0.4-1.fc10.i386 libXcursor-1.1.9-3.fc10.i386 libXdmcp-1.0.2-6.fc10.i386 libXext-1.0.4-1.fc9.i386 libXfixes-devel-4.0.3-4.fc10.i386 libXft-2.1.13-1.fc10.i386 libXi-devel-1.1.3-4.fc9.i386 libXinerama-1.0.3-2.fc10.i386 libXpm-3.5.7-4.fc9.i386 libXrandr-1.2.3-1.fc10.i386 libXrender-0.9.4-3.fc9.i386 libXtst-1.0.3-3.fc9.i386 libcap-2.10-2.fc10.i386 libgcc-4.3.2-7.i386 libjpeg-6b-43.fc10.i386 libmng-1.0.9-7.i386 libpng-1.2.35-1.fc10.i386 libstdc++-4.3.2-7.i386 libtiff-3.8.2-11.fc10.i386 libxcb-1.1.91-5.fc10.i386 linuxwacom-0.8.0.3-8.fc10.i386 qwt-5.1.1-2.fc10.i386 zlib-1.2.3-18.fc9.i386
    4. (gdb) bt
    5. #0 0x00c84073 in QwtPlot::legendItemChecked () from /usr/lib/libqwt.so.5
    6. #1 0x00c9cb18 in QwtPlotCanvas::drawCanvas () from /usr/lib/libqwt.so.5
    7. #2 0x00c9cdd0 in QwtPlotCanvas::drawContents () from /usr/lib/libqwt.so.5
    8. #3 0x00c9cfdf in QwtPlotCanvas::paintEvent () from /usr/lib/libqwt.so.5
    9. #4 0x010143ce in QWidget::event (this=0x83d02e0, event=0xbfffe114) at kernel/qwidget.cpp:7654
    10. #5 0x013c9383 in QFrame::event (this=0x83d02e0, e=0xbfffe114) at widgets/qframe.cpp:559
    11. #6 0x00fbda7c in QApplicationPrivate::notify_helper (this=0x812ee90, receiver=0x83d02e0, e=0xbfffe114) at kernel/qapplication.cpp:4084
    12. #7 0x00fc5e42 in QApplication::notify (this=0xbffff0d8, receiver=0x83d02e0, e=0xbfffe114) at kernel/qapplication.cpp:4049
    13. #8 0x035e712b in QCoreApplication::notifyInternal (this=0xbffff0d8, receiver=0x83d02e0, event=0xbfffe114) at kernel/qcoreapplication.cpp:602
    14. #9 0x00fc8bae in QCoreApplication::sendSpontaneousEvent (receiver=0x83d02e0, event=0x1) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:216
    15. #10 0x0101c1c9 in QWidgetPrivate::drawWidget (this=0x83d0300, pdev=0x8192ee4, rgn=@0xbfffe3d8, offset=@0xbfffe3a8, flags=68, sharedPainter=0x0, backingStore=0x81931d0)
    16. at kernel/qwidget.cpp:5046
    To copy to clipboard, switch view to plain text mode 

  11. #11
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    There is no call of QwtPlot::legendItemChecked() in QwtPlotCanvas::drawCanvas() -> you have a build problem on your side.

    Looking at your stack I can see, that your application was running against a library /usr/lib/libqwt.so.5. Are you sure, that this is the library you have built from the Qwt 5.2 tarball ? What are the Qwt headers you have built your application with ?

    Uwe

    PS: Do you now ldd, ldconfig, LD_LIBRARY_PATH and friends ?

  12. #12
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    OK, you're right.
    But still, also with Qwt-5.2, the problems of the export of SVG plot remains...

  13. #13
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt 5.1 + Qt 4.5 - SVG no clipping

    Because now you are running against 5.1 ?

    Start the bode example, zoom in and press the SVG button ( this is exactly the same situation you have in your application.) When in the exported SVG all curves are clipped against the canvas borders you have the right Qwt version. If not download and build Qwt 5.2 and recompile your application.

    Then adjust your LD_LIBRARY_PATH. Check with ldd, that your application really runs against the 5.2 libs.

    Uwe

  14. The following user says thank you to Uwe for this useful post:

    giusepped (14th April 2009)

Similar Threads

  1. QWT embedded
    By damien in forum Qwt
    Replies: 3
    Last Post: 20th February 2011, 19:26
  2. Step by step Qwt on MinGW
    By Doug Broadwell in forum Qwt
    Replies: 2
    Last Post: 23rd January 2009, 00:19
  3. QWT introduction
    By nitriles in forum Qwt
    Replies: 4
    Last Post: 28th September 2007, 10:48
  4. How to upgrade Qwt 5.0.1 to Qwt 5.0.2
    By luffy27 in forum Qwt
    Replies: 1
    Last Post: 15th July 2007, 19:55
  5. use interesting QWT Library with QT3.X
    By raphaelf in forum Qwt
    Replies: 2
    Last Post: 23rd January 2006, 11:24

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.