Results 1 to 3 of 3

Thread: QwtPlotShapeItem does not display line shapes (height or width = 0)

  1. #1
    Join Date
    Dec 2015
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPlotShapeItem does not display line shapes (height or width = 0)

    Hello,
    we use the class QwtPlotShapeItem to display various shapes on a canvas. One shape is a QPainterPath with only one start and one end point. Once the start and end point
    lies either on a vertical or horizontal line, the shape is not displayed any more. The most obvious reason for this might be in the method QwtPlotShapeItem::draw (line 379 in qwt_plot_shapeitem.cpp):

    The command
    Qt Code:
    1. d_data->boundingRect.intersects( cRect )
    To copy to clipboard, switch view to plain text mode 
    returns false, since
    Qt Code:
    1. d_data->boundingRect
    To copy to clipboard, switch view to plain text mode 
    has either a width or height of 0.000.
    Then the intersects command of Qt returns false and no line is drawn. Is it possible to change this code to allows such shapes? One workaround might also be to create
    a bounding box with a width or height slightly bigger than zero. Or is it not desired to print such shapes using this class? What is the right way then?

    Thanks in advance.

    Cheers
    Marc

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

    Default Re: QwtPlotShapeItem does not display line shapes (height or width = 0)

    IMO this is just a bug - the intention of the check is to clip away content, that is not in the visible area.
    Please add a bug report at http://sourceforge.net/p/qwt/bugs - I will fix it soon ( next time I'm working on the code ).

    Thanks for reporting,
    Uwe

  3. #3
    Join Date
    Dec 2015
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotShapeItem does not display line shapes (height or width = 0)

    Hi Uwe,

    thanks for the answer. I created the bugfix under https://sourceforge.net/p/qwt/bugs/255/. I also tested a fix in the plots of our open source software itom (http://itom.bitbucket.org) that works. I posted the possible solution in the bug report, too.
    Hopefully, it helps you to easily fix this.

    Thanks
    Marc

Similar Threads

  1. how to get image height and width in qt
    By iswaryasenthilkumar in forum Newbie
    Replies: 1
    Last Post: 31st March 2015, 06:52
  2. Pusbutton height and width
    By seany in forum Qt Programming
    Replies: 6
    Last Post: 7th June 2013, 06:35
  3. Widget Height and Width
    By in_dbasu in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2011, 08:44
  4. Fix proportion of width and height in QGridLayout
    By Wong in forum Qt Programming
    Replies: 6
    Last Post: 7th January 2011, 07:24
  5. width and height of QTabWidget
    By chikkireddi in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 13:53

Tags for this Thread

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.