Results 1 to 4 of 4

Thread: Issues when upgrading Qwt from 6.0.2 to 6.1.0

  1. #1
    Join Date
    Oct 2012
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face Issues when upgrading Qwt from 6.0.2 to 6.1.0

    Hi All,

    First of all, Qwt is an excellent plot library.
    I met two issues when I'm trying upgrade qwt from 6.0.2 to 6.1.0.
    1. X axis zoom only (see pic please). I overwritten drawRubberBand of QwtPlotZoomer. But it doens't work with Qwt-6.1.0.
    zoomer.png
    Qt Code:
    1. void TrendPlotZoomer::drawRubberBand(QPainter* painter) const
    2. {
    3. const QPolygon pa = adjustedPoints(pickedPoints());
    4. if (pa.count() < 2)
    5. return;
    6.  
    7. const QPoint& p1 = pa.first();
    8. const QPoint& p2 = pa.last();
    9.  
    10. QRect rect = QRect(p1, p2).normalized();
    11. QRectF prect = pickArea().boundingRect();
    12. rect.setY(prect.y());
    13. rect.setHeight(prect.height());
    14.  
    15. if (painter->pen().color() != Qt::color1) {
    16.  
    17. QColor color = painter->pen().color();
    18. color.setAlpha(50);
    19. painter->setBrush(color);
    20. }
    21. else {
    22. painter->setBrush(painter->pen().color());
    23. }
    24.  
    25. QwtPainter::drawRect(painter, rect);
    26. }
    To copy to clipboard, switch view to plain text mode 



    2. How to hide the frame line of canvas in 6.1.0?
    With 6.0.2, I did like this:
    Qt Code:
    1. canvas()->setLineWidth(0);
    2. canvas()->setFrameStyle(QFrame::StyledPanel | QFrame::Plain);
    To copy to clipboard, switch view to plain text mode 

    Althrough the canvas is an instance of QFrame, I want to how to turn off the frame line elegantly.

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

    Default Re: Issues when upgrading Qwt from 6.0.2 to 6.1.0

    Quote Originally Posted by freshairfly View Post
    1. X axis zoom only (see pic please). I overwritten drawRubberBand of QwtPlotZoomer. But it doens't work with Qwt-6.1.0..
    What exactly means "doesn't work" ?

    Quote Originally Posted by freshairfly View Post
    2. How to hide the frame line of canvas in 6.1.0?
    In Qwt 6.1 you can have a QwtPlotCanvas or a QwtPlotGLCanvas, where QWidget is the common base class. That's why QwtPlot::canvas() returns a QWidget now.
    You might use use a dynamic_cast - or like it is done in the examples:

    Qt Code:
    1. QwtPlotCanvas *canvas = new QwtPlotCanvas();
    2. canvas->setXYZ(...);
    3.  
    4. plot->setCanvas( canvas );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. #3
    Join Date
    Oct 2012
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Issues when upgrading Qwt from 6.0.2 to 6.1.0

    Uwe,

    Thanks for your reply.
    "Doesn't work" means doesn't draw the "rubber band" same as 6.0.2.
    To zoom on X axis only, when user dragging the mouse, the "Rubber Band" should be full of canvas on Y direction with semitransparent background (just like the pic of previsous post).

    The code I posted previous did work as I expected. But when I upgrade the Qwt to 6.1.0. The "Rubber Band" looks like this:
    zoomer_new.png
    I debug the code, and I found setClipPath&setClipRect in QwtWidgetOverlay should be the reason. So my question is how to draw the "Rubber Band" same as Qwt6.0.2 exactly.

  4. #4
    Join Date
    Oct 2012
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Issues when upgrading Qwt from 6.0.2 to 6.1.0

    Uwe,

    The issue was resolved via overwritting the rubberBandMask() of the zoomer.

    Thanks again.

Similar Threads

  1. Upgrading to Qt 5
    By aguleo in forum Newbie
    Replies: 1
    Last Post: 20th February 2013, 16:27
  2. Issues upgrading Ubuntu (9.10 to 10.04) and Qt (4.5.2 to 4.6.2)
    By bobrien in forum Installation and Deployment
    Replies: 0
    Last Post: 1st March 2011, 17:24
  3. Upgrading from Qt3 to Qt4
    By Cutey in forum Installation and Deployment
    Replies: 7
    Last Post: 2nd July 2008, 13:01
  4. Upgrading installation
    By Djony in forum Installation and Deployment
    Replies: 2
    Last Post: 30th November 2006, 17:42
  5. upgrading from 4.1.4 to 4.2.0
    By mandal in forum Installation and Deployment
    Replies: 4
    Last Post: 6th November 2006, 15:21

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.