Results 1 to 4 of 4

Thread: Several issues with QWT 6.1 and Qt 5.0.2

  1. #1

    Default Several issues with QWT 6.1 and Qt 5.0.2

    I've encountered some problems compiling my old project that was initially built with Qt 4.8 and Qwt 6.0.2.

    1. QwtText doesn't have the setBackgroundPen option anymore. What's the correct way to apply a QPen to the background of a QwtText object?
    2. canvas() is apparently a QWidget object the newer version. Should I simply reassigning all QwtPlotCanvas* objects as QWidget*'s (it seems to do the trick) ?
    3. The QwtPlotRenderer::KeepFrames option is missing. What alternative can you suggest for the renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames ,true) function?
    4. The setItemAttribute(QwtPlotItem::Legend,false) option for a QwtPlotCurve is present in the build (previously mentioned issues produce a compilation error) but it doesn't seem to be working properly. I've previously used this function to omit some of the curves from the legend but in this newer build all of the "hidden" curves are visible.


    Can someone verify these issues?

  2. #2
    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: Several issues with QWT 6.1 and Qt 5.0.2

    What's the correct way to apply a QPen to the background of a QwtText object?
    QwtText::setBorderPen()

    canvas() is apparently a QWidget object the newer version. Should I simply reassigning all QwtPlotCanvas* objects as QWidget*'s
    The canvas can be a QwtPlotCanvas, a QwtPlotGLCanvas or any other widget you have passed with QwtPlot::setCanvas(), that offers a couple of methods, that are documented there.

    The QwtPlotRenderer::KeepFrames option is missing.
    The default setting is to render WYSWYG as much as possible - what includes the frames as default. In 6.0 rendering of the frames is disabled in the default setting, because it was not implemented properly.

    The setItemAttribute(QwtPlotItem::Legend,false) option for a QwtPlotCurve is present in the build (previously mentioned issues produce a compilation error) but it doesn't seem to be working properly.
    Is intended to work - please upload a small compilable demo demonstrating the situation.

    Uwe

  3. #3

    Default Re: Several issues with QWT 6.1 and Qt 5.0.2

    Quote Originally Posted by Uwe View Post
    Is intended to work - please upload a small compilable demo demonstrating the situation.

    Well the code might be a bit messy but it goes like this:
    Qt Code:
    1. // "number" is an integer that numerates a PlotCurve; "PlotCurve" is a "QwtPlotCurve **PlotCurve";
    2. switch(number%4)
    3. {
    4. case 1:
    5. {
    6. PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
    7. pen.setStyle(Qt::DashLine);
    8. break;
    9. }
    10. case 2:
    11. {
    12. PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
    13. pen.setStyle(Qt::DotLine);
    14. break;
    15. }
    16. case 3:
    17. {
    18. PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
    19. pen.setStyle(Qt::DashDotLine);
    20. break;
    21. }
    22. default:
    23. {
    24. break;
    25. }
    26. }
    To copy to clipboard, switch view to plain text mode 

    Basically I use this function to assign the same colored legend item for 4 different curves (that have different styles). In Qwt 6.0.1-2 it looks like this:
    qwt602.jpg
    whereas in Qwt 6.1 the same exact code generates this:
    qwt610.jpg
    I don't know whether this piece of code is comprehensible enough. I can elaborate more if necessary.
    Last edited by DizzyMoods; 16th April 2013 at 13:25.

  4. #4
    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: Several issues with QWT 6.1 and Qt 5.0.2

    Quote Originally Posted by DizzyMoods View Post
    I don't know whether this piece of code is comprehensible enough. I can elaborate more if necessary.
    As I said: please upload a small compilable demo.

    Uwe

Similar Threads

  1. QX11EmbedContainer issues when SSH
    By snydesc in forum Qt Programming
    Replies: 0
    Last Post: 13th February 2013, 15:33
  2. Issues with Uic.
    By queelius in forum Qt Programming
    Replies: 4
    Last Post: 2nd December 2010, 13:37
  3. Some issues with qrand.
    By def in forum Newbie
    Replies: 5
    Last Post: 26th November 2010, 19:57
  4. Translation issues
    By Auliyaa in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2010, 15:14
  5. 4.6.0 issues on OS X 10.6 with GL
    By treaves in forum Qt Programming
    Replies: 2
    Last Post: 2nd December 2009, 17:12

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.