Results 1 to 3 of 3

Thread: QwtPlotLegendItem empty data

  1. #1
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QwtPlotLegendItem empty data

    I'm add QwtPlotLegendItem to QwtPlot without the curves.
    Empty rect displayed. See attach.

    Function code:
    QRect QwtPlotLegendItem::geometry( const QRectF &canvasRect ) const
    {
    QRect rect;
    rect.setSize( d_data->layout->sizeHint() );


    As a result, the function returns a non-empty rectangle.

    I fixed it in the derived class like this:
    QRect MyLegendItem::geometry(const QRectF &canvasRect) const
    {
    QRect r = QwtPlotLegendItem::geometry(canvasRect);
    if (r.width() < 0 || r.height() < 0)
    r = QRect();
    return r;
    }


    Need to add content checking.
    What do you think about this?
    Attached Images Attached Images

  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: QwtPlotLegendItem empty data

    I changed QwtPlotLegendItem::draw() not drawing something, when having an empty geometry. Fixed in all SVN branches >= 6.1,

    Uwe

  3. #3
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlotLegendItem empty data

    Uwe,
    Thank you ever so!

Similar Threads

  1. A suggestion about QwtPlotLegendItem
    By Nicho in forum Qwt
    Replies: 4
    Last Post: 7th April 2015, 12:06
  2. How to clear/empty data from a QSslSocket
    By scieck in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2011, 23:47
  3. Replies: 0
    Last Post: 29th April 2011, 09:02
  4. Replies: 4
    Last Post: 16th January 2010, 10:08
  5. Empty SQL Data from ODBC/FreeTDS
    By dentharg in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2009, 07:50

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.