Loading...
Searching...
No Matches
qwt_plot_legenditem.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_plot_legenditem.h"
#include "qwt_dyngrid_layout.h"
#include "qwt_text.h"
#include "qwt_graphic.h"
#include "qwt_legend_data.h"
#include "qwt_math.h"
#include <qlayoutitem.h>
#include <qpen.h>
#include <qbrush.h>
#include <qpainter.h>
namespace
{
class LayoutItem QWT_FINAL : public QLayoutItem
{
public:
LayoutItem( const QwtPlotLegendItem*, const QwtPlotItem* );
virtual ~LayoutItem();
const QwtPlotItem* plotItem() const;
void setData( const QwtLegendData& );
const QwtLegendData& data() const;
virtual Qt::Orientations expandingDirections() const QWT_OVERRIDE;
virtual QRect geometry() const QWT_OVERRIDE;
virtual bool hasHeightForWidth() const QWT_OVERRIDE;
virtual int heightForWidth( int ) const QWT_OVERRIDE;
virtual bool isEmpty() const QWT_OVERRIDE;
virtual QSize maximumSize() const QWT_OVERRIDE;
virtual int minimumHeightForWidth( int ) const QWT_OVERRIDE;
virtual QSize minimumSize() const QWT_OVERRIDE;
virtual void setGeometry( const QRect& ) QWT_OVERRIDE;
virtual QSize sizeHint() const QWT_OVERRIDE;
private:
const QwtPlotLegendItem* m_legendItem;
const QwtPlotItem* m_plotItem;
QwtLegendData m_data;
QRect m_rect;
};
LayoutItem::LayoutItem(
const QwtPlotLegendItem* legendItem, const QwtPlotItem* plotItem )
: m_legendItem( legendItem )
, m_plotItem( plotItem)
{
}
LayoutItem::~LayoutItem()
{
}
const QwtPlotItem* LayoutItem::plotItem() const
{
return m_plotItem;
}
void LayoutItem::setData( const QwtLegendData& data )
{
m_data = data;
}
const QwtLegendData& LayoutItem::data() const
{
return m_data;
}
Qt::Orientations LayoutItem::expandingDirections() const
{
return Qt::Horizontal;
}
bool LayoutItem::hasHeightForWidth() const
{
return !m_data.title().isEmpty();
}
int LayoutItem::minimumHeightForWidth( int w ) const
{
return m_legendItem->heightForWidth( m_data, w );
}
int LayoutItem::heightForWidth( int w ) const
{
return m_legendItem->heightForWidth( m_data, w );
}
bool LayoutItem::isEmpty() const
{
return false;
}
QSize LayoutItem::maximumSize() const
{
return QSize( QLAYOUTSIZE_MAX, QLAYOUTSIZE_MAX );
}
QSize LayoutItem::minimumSize() const
{
return m_legendItem->minimumSize( m_data );
}
QSize LayoutItem::sizeHint() const
{
return minimumSize();
}
void LayoutItem::setGeometry( const QRect& rect )
{
m_rect = rect;
}
QRect LayoutItem::geometry() const
{
return m_rect;
}
}
class QwtPlotLegendItem::PrivateData
{
public:
PrivateData()
: itemMargin( 4 )
, itemSpacing( 4 )
, borderRadius( 0.0 )
, borderPen( Qt::NoPen )
, backgroundBrush( Qt::NoBrush )
, backgroundMode( QwtPlotLegendItem::LegendBackground )
, canvasAlignment( Qt::AlignRight | Qt::AlignBottom )
{
canvasOffset[ 0 ] = canvasOffset[1] = 10;
layout = new QwtDynGridLayout();
layout->setMaxColumns( 2 );
layout->setSpacing( 0 );
layout->setContentsMargins( 0, 0, 0, 0 );
}
~PrivateData()
{
delete layout;
}
QFont font;
QPen textPen;
int itemMargin;
int itemSpacing;
double borderRadius;
QPen borderPen;
QBrush backgroundBrush;
QwtPlotLegendItem::BackgroundMode backgroundMode;
int canvasOffset[2];
Qt::Alignment canvasAlignment;
QMap< const QwtPlotItem*, QList< LayoutItem* > > map;
QwtDynGridLayout* layout;
};
QwtPlotLegendItem::QwtPlotLegendItem()
: QwtPlotItem( QwtText( "Legend" ) )
{
m_data = new PrivateData;
setItemInterest( QwtPlotItem::LegendInterest, true );
setZ( 100.0 );
}
QwtPlotLegendItem::~QwtPlotLegendItem()
{
clearLegend();
delete m_data;
}
int QwtPlotLegendItem::rtti() const
{
return QwtPlotItem::Rtti_PlotLegend;
}
void QwtPlotLegendItem::setAlignmentInCanvas( Qt::Alignment alignment )
{
if ( m_data->canvasAlignment != alignment )
{
m_data->canvasAlignment = alignment;
itemChanged();
}
}
Qt::Alignment QwtPlotLegendItem::alignmentInCanvas() const
{
return m_data->canvasAlignment;
}
void QwtPlotLegendItem::setMaxColumns( uint maxColumns )
{
if ( maxColumns != m_data->layout->maxColumns() )
{
m_data->layout->setMaxColumns( maxColumns );
itemChanged();
}
}
uint QwtPlotLegendItem::maxColumns() const
{
return m_data->layout->maxColumns();
}
void QwtPlotLegendItem::setMargin( int margin )
{
margin = qMax( margin, 0 );
if ( margin != this->margin() )
{
m_data->layout->setContentsMargins(
margin, margin, margin, margin );
itemChanged();
}
}
int QwtPlotLegendItem::margin() const
{
int left;
m_data->layout->getContentsMargins( &left, NULL, NULL, NULL );
return left;
}
void QwtPlotLegendItem::setSpacing( int spacing )
{
spacing = qMax( spacing, 0 );
if ( spacing != m_data->layout->spacing() )
{
m_data->layout->setSpacing( spacing );
itemChanged();
}
}
int QwtPlotLegendItem::spacing() const
{
return m_data->layout->spacing();
}
void QwtPlotLegendItem::setItemMargin( int margin )
{
margin = qMax( margin, 0 );
if ( margin != m_data->itemMargin )
{
m_data->itemMargin = margin;
m_data->layout->invalidate();
itemChanged();
}
}
int QwtPlotLegendItem::itemMargin() const
{
return m_data->itemMargin;
}
void QwtPlotLegendItem::setItemSpacing( int spacing )
{
spacing = qMax( spacing, 0 );
if ( spacing != m_data->itemSpacing )
{
m_data->itemSpacing = spacing;
m_data->layout->invalidate();
itemChanged();
}
}
int QwtPlotLegendItem::itemSpacing() const
{
return m_data->itemSpacing;
}
void QwtPlotLegendItem::setFont( const QFont& font )
{
if ( font != m_data->font )
{
m_data->font = font;
m_data->layout->invalidate();
itemChanged();
}
}
QFont QwtPlotLegendItem::font() const
{
return m_data->font;
}
void QwtPlotLegendItem::setOffsetInCanvas(
Qt::Orientations orientations, int numPixels )
{
if ( numPixels < 0 )
numPixels = -1;
bool isChanged = false;
int* offset = m_data->canvasOffset;
if ( orientations & Qt::Horizontal )
{
if ( numPixels != offset[0] )
{
offset[0] = numPixels;
isChanged = true;
}
}
if ( orientations & Qt::Vertical )
{
if ( numPixels != offset[1] )
{
offset[1] = numPixels;
isChanged = true;
}
}
if ( isChanged )
itemChanged();
}
int QwtPlotLegendItem::offsetInCanvas(
Qt::Orientation orientation ) const
{
const int index = ( orientation == Qt::Vertical ) ? 1 : 0;
return m_data->canvasOffset[index];
}
void QwtPlotLegendItem::setBorderRadius( double radius )
{
radius = qwtMaxF( 0.0, radius );
if ( radius != m_data->borderRadius )
{
m_data->borderRadius = radius;
itemChanged();
}
}
double QwtPlotLegendItem::borderRadius() const
{
return m_data->borderRadius;
}
void QwtPlotLegendItem::setBorderPen( const QPen& pen )
{
if ( m_data->borderPen != pen )
{
m_data->borderPen = pen;
itemChanged();
}
}
QPen QwtPlotLegendItem::borderPen() const
{
return m_data->borderPen;
}
void QwtPlotLegendItem::setBackgroundBrush( const QBrush& brush )
{
if ( m_data->backgroundBrush != brush )
{
m_data->backgroundBrush = brush;
itemChanged();
}
}
QBrush QwtPlotLegendItem::backgroundBrush() const
{
return m_data->backgroundBrush;
}
void QwtPlotLegendItem::setBackgroundMode( BackgroundMode mode )
{
if ( mode != m_data->backgroundMode )
{
m_data->backgroundMode = mode;
itemChanged();
}
}
QwtPlotLegendItem::BackgroundMode QwtPlotLegendItem::backgroundMode() const
{
return m_data->backgroundMode;
}
void QwtPlotLegendItem::setTextPen( const QPen& pen )
{
if ( m_data->textPen != pen )
{
m_data->textPen = pen;
itemChanged();
}
}
QPen QwtPlotLegendItem::textPen() const
{
return m_data->textPen;
}
void QwtPlotLegendItem::draw( QPainter* painter,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect ) const
{
Q_UNUSED( xMap );
Q_UNUSED( yMap );
m_data->layout->setGeometry( geometry( canvasRect ) );
if ( m_data->layout->geometry().isEmpty() )
{
// don't draw a legend when having no content
return;
}
if ( m_data->backgroundMode == QwtPlotLegendItem::LegendBackground )
drawBackground( painter, m_data->layout->geometry() );
for ( int i = 0; i < m_data->layout->count(); i++ )
{
const LayoutItem* layoutItem =
static_cast< LayoutItem* >( m_data->layout->itemAt( i ) );
if ( m_data->backgroundMode == QwtPlotLegendItem::ItemBackground )
drawBackground( painter, layoutItem->geometry() );
painter->save();
drawLegendData( painter, layoutItem->plotItem(),
layoutItem->data(), layoutItem->geometry() );
painter->restore();
}
}
void QwtPlotLegendItem::drawBackground(
QPainter* painter, const QRectF& rect ) const
{
painter->save();
painter->setPen( m_data->borderPen );
painter->setBrush( m_data->backgroundBrush );
const double radius = m_data->borderRadius;
painter->drawRoundedRect( rect, radius, radius );
painter->restore();
}
QRect QwtPlotLegendItem::geometry( const QRectF& canvasRect ) const
{
QRect rect;
rect.setSize( m_data->layout->sizeHint() );
if ( m_data->canvasAlignment & Qt::AlignHCenter )
{
int x = qRound( canvasRect.center().x() );
rect.moveCenter( QPoint( x, rect.center().y() ) );
}
else if ( m_data->canvasAlignment & Qt::AlignRight )
{
const int offset = offsetInCanvas( Qt::Horizontal );
rect.moveRight( qwtFloor( canvasRect.right() - offset ) );
}
else
{
const int offset = offsetInCanvas( Qt::Horizontal );
rect.moveLeft( qwtCeil( canvasRect.left() + offset ) );
}
if ( m_data->canvasAlignment & Qt::AlignVCenter )
{
int y = qRound( canvasRect.center().y() );
rect.moveCenter( QPoint( rect.center().x(), y ) );
}
else if ( m_data->canvasAlignment & Qt::AlignBottom )
{
const int offset = offsetInCanvas( Qt::Vertical );
rect.moveBottom( qwtFloor( canvasRect.bottom() - offset ) );
}
else
{
const int offset = offsetInCanvas( Qt::Vertical );
rect.moveTop( qwtCeil( canvasRect.top() + offset ) );
}
return rect;
}
void QwtPlotLegendItem::updateLegend( const QwtPlotItem* plotItem,
const QList< QwtLegendData >& data )
{
if ( plotItem == NULL )
return;
QList< LayoutItem* > layoutItems;
QMap< const QwtPlotItem*, QList< LayoutItem* > >::const_iterator it =
m_data->map.constFind( plotItem );
if ( it != m_data->map.constEnd() )
layoutItems = it.value();
bool changed = false;
if ( data.size() != layoutItems.size() )
{
changed = true;
for ( int i = 0; i < layoutItems.size(); i++ )
{
m_data->layout->removeItem( layoutItems[i] );
delete layoutItems[i];
}
layoutItems.clear();
if ( it != m_data->map.constEnd() )
m_data->map.remove( plotItem );
if ( !data.isEmpty() )
{
layoutItems.reserve( data.size() );
for ( int i = 0; i < data.size(); i++ )
{
LayoutItem* layoutItem =
new LayoutItem( this, plotItem );
m_data->layout->addItem( layoutItem );
layoutItems += layoutItem;
}
m_data->map.insert( plotItem, layoutItems );
}
}
for ( int i = 0; i < data.size(); i++ )
{
if ( layoutItems[i]->data().values() != data[i].values() )
{
layoutItems[i]->setData( data[i] );
changed = true;
}
}
if ( changed )
{
m_data->layout->invalidate();
itemChanged();
}
}
void QwtPlotLegendItem::clearLegend()
{
if ( !m_data->map.isEmpty() )
{
m_data->map.clear();
for ( int i = m_data->layout->count() - 1; i >= 0; i-- )
delete m_data->layout->takeAt( i );
itemChanged();
}
}
void QwtPlotLegendItem::drawLegendData( QPainter* painter,
const QwtPlotItem* plotItem, const QwtLegendData& data,
const QRectF& rect ) const
{
Q_UNUSED( plotItem );
const int m = m_data->itemMargin;
const QRectF r = rect.toRect().adjusted( m, m, -m, -m );
painter->setClipRect( r, Qt::IntersectClip );
int titleOff = 0;
const QwtGraphic graphic = data.icon();
if ( !graphic.isEmpty() )
{
QRectF iconRect( r.topLeft(), graphic.defaultSize() );
iconRect.moveCenter(
QPoint( iconRect.center().x(), rect.center().y() ) );
graphic.render( painter, iconRect, Qt::KeepAspectRatio );
titleOff += iconRect.width() + m_data->itemSpacing;
}
const QwtText text = data.title();
if ( !text.isEmpty() )
{
painter->setPen( textPen() );
painter->setFont( font() );
const QRectF textRect = r.adjusted( titleOff, 0, 0, 0 );
text.draw( painter, textRect );
}
}
QSize QwtPlotLegendItem::minimumSize( const QwtLegendData& data ) const
{
QSize size( 2 * m_data->itemMargin, 2 * m_data->itemMargin );
if ( !data.isValid() )
return size;
const QwtGraphic graphic = data.icon();
const QwtText text = data.title();
int w = 0;
int h = 0;
if ( !graphic.isNull() )
{
w = graphic.width();
h = graphic.height();
}
if ( !text.isEmpty() )
{
const QSizeF sz = text.textSize( font() );
w += qwtCeil( sz.width() );
h = qMax( h, qwtCeil( sz.height() ) );
}
if ( graphic.width() > 0 && !text.isEmpty() )
w += m_data->itemSpacing;
size += QSize( w, h );
return size;
}
int QwtPlotLegendItem::heightForWidth(
const QwtLegendData& data, int width ) const
{
width -= 2 * m_data->itemMargin;
const QwtGraphic graphic = data.icon();
const QwtText text = data.title();
if ( text.isEmpty() )
return graphic.height();
if ( graphic.width() > 0 )
width -= graphic.width() + m_data->itemSpacing;
int h = text.heightForWidth( width, font() );
h += 2 * m_data->itemMargin;
return qMax( graphic.height(), h );
}
QList< const QwtPlotItem* > QwtPlotLegendItem::plotItems() const
{
return m_data->map.keys();
}
QList< QRect > QwtPlotLegendItem::legendGeometries(
const QwtPlotItem* plotItem ) const
{
QList< LayoutItem* > layoutItems;
QMap< const QwtPlotItem*, QList< LayoutItem* > >::const_iterator it =
m_data->map.constFind( plotItem );
if ( it != m_data->map.constEnd() )
layoutItems = it.value();
QList< QRect > geometries;
geometries.reserve(layoutItems.size() );
for ( int i = 0; i < layoutItems.size(); i++ )
geometries += layoutItems[i]->geometry();
return geometries;
}
QList
Definition qwt_abstract_legend.h:17
QMap
Definition qwt_compass.h:19
QwtDynGridLayout
The QwtDynGridLayout class lays out widgets in a grid, adjusting the number of columns and rows to th...
Definition qwt_dyngrid_layout.h:28
QwtDynGridLayout::itemAt
virtual QLayoutItem * itemAt(int index) const override
Definition qwt_dyngrid_layout.cpp:157
QwtDynGridLayout::isEmpty
virtual bool isEmpty() const override
Definition qwt_dyngrid_layout.cpp:137
QwtDynGridLayout::takeAt
virtual QLayoutItem * takeAt(int index) override
Definition qwt_dyngrid_layout.cpp:172
QwtDynGridLayout::sizeHint
virtual QSize sizeHint() const override
Definition qwt_dyngrid_layout.cpp:550
QwtDynGridLayout::maxColumns
uint maxColumns() const
Return the upper limit for the number of columns.
Definition qwt_dyngrid_layout.cpp:119
QwtDynGridLayout::setMaxColumns
void setMaxColumns(uint maxColumns)
Definition qwt_dyngrid_layout.cpp:106
QwtDynGridLayout::addItem
virtual void addItem(QLayoutItem *) override
Add an item to the next free position.
Definition qwt_dyngrid_layout.cpp:128
QwtDynGridLayout::setGeometry
virtual void setGeometry(const QRect &) override
Definition qwt_dyngrid_layout.cpp:222
QwtDynGridLayout::count
virtual int count() const override
Definition qwt_dyngrid_layout.cpp:182
QwtDynGridLayout::invalidate
virtual void invalidate() override
Invalidate all internal caches.
Definition qwt_dyngrid_layout.cpp:95
QwtGraphic
A paint device for scalable graphics.
Definition qwt_graphic.h:76
QwtGraphic::isEmpty
bool isEmpty() const
Definition qwt_graphic.cpp:422
QwtGraphic::isNull
bool isNull() const
Definition qwt_graphic.cpp:413
QwtGraphic::defaultSize
QSizeF defaultSize() const
Default size.
Definition qwt_graphic.cpp:574
QwtGraphic::render
void render(QPainter *) const
Replay all recorded painter commands.
Definition qwt_graphic.cpp:624
QwtLegendData
Attributes of an entry on a legend.
Definition qwt_legend_data.h:37
QwtLegendData::isValid
bool isValid() const
Definition qwt_legend_data.cpp:82
QwtLegendData::icon
QwtGraphic icon() const
Definition qwt_legend_data.cpp:106
QwtLegendData::title
QwtText title() const
Definition qwt_legend_data.cpp:88
QwtPlotItem
Base class for items on the plot canvas.
Definition qwt_plot_item.h:67
QwtPlotItem::setZ
void setZ(double z)
Set the z value.
Definition qwt_plot_item.cpp:165
QwtPlotItem::Rtti_PlotLegend
@ Rtti_PlotLegend
For QwtPlotLegendItem.
Definition qwt_plot_item.h:87
QwtPlotItem::setItemInterest
void setItemInterest(ItemInterest, bool on=true)
Definition qwt_plot_item.cpp:279
QwtPlotItem::itemChanged
virtual void itemChanged()
Definition qwt_plot_item.cpp:481
QwtPlotItem::LegendInterest
@ LegendInterest
Definition qwt_plot_item.h:197
QwtPlotLegendItem
A class which draws a legend inside the plot canvas.
Definition qwt_plot_legenditem.h:42
QwtPlotLegendItem::spacing
int spacing() const
Definition qwt_plot_legenditem.cpp:308
QwtPlotLegendItem::setOffsetInCanvas
void setOffsetInCanvas(Qt::Orientations, int numPixels)
Set the distance between the legend and the canvas border.
Definition qwt_plot_legenditem.cpp:405
QwtPlotLegendItem::BackgroundMode
BackgroundMode
Background mode.
Definition qwt_plot_legenditem.h:55
QwtPlotLegendItem::LegendBackground
@ LegendBackground
The legend has a background.
Definition qwt_plot_legenditem.h:57
QwtPlotLegendItem::ItemBackground
@ ItemBackground
Each item has a background.
Definition qwt_plot_legenditem.h:60
QwtPlotLegendItem::offsetInCanvas
int offsetInCanvas(Qt::Orientation) const
Definition qwt_plot_legenditem.cpp:444
QwtPlotLegendItem::geometry
virtual QRect geometry(const QRectF &canvasRect) const
Definition qwt_plot_legenditem.cpp:650
QwtPlotLegendItem::font
QFont font() const
Definition qwt_plot_legenditem.cpp:389
QwtPlotLegendItem::backgroundMode
BackgroundMode backgroundMode() const
Definition qwt_plot_legenditem.cpp:550
QwtPlotLegendItem::setBackgroundMode
void setBackgroundMode(BackgroundMode)
Set the background mode.
Definition qwt_plot_legenditem.cpp:537
QwtPlotLegendItem::draw
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
Definition qwt_plot_legenditem.cpp:587
QwtPlotLegendItem::updateLegend
virtual void updateLegend(const QwtPlotItem *, const QList< QwtLegendData > &) override
Definition qwt_plot_legenditem.cpp:697
QwtPlotLegendItem::backgroundBrush
QBrush backgroundBrush() const
Definition qwt_plot_legenditem.cpp:522
QwtPlotLegendItem::setAlignmentInCanvas
void setAlignmentInCanvas(Qt::Alignment)
Set the alignmnet.
Definition qwt_plot_legenditem.cpp:210
QwtPlotLegendItem::setMargin
void setMargin(int)
Set the margin around legend items.
Definition qwt_plot_legenditem.cpp:264
QwtPlotLegendItem::QwtPlotLegendItem
QwtPlotLegendItem()
Constructor.
Definition qwt_plot_legenditem.cpp:175
QwtPlotLegendItem::itemMargin
int itemMargin() const
Definition qwt_plot_legenditem.cpp:335
QwtPlotLegendItem::alignmentInCanvas
Qt::Alignment alignmentInCanvas() const
Definition qwt_plot_legenditem.cpp:223
QwtPlotLegendItem::setItemSpacing
void setItemSpacing(int)
Definition qwt_plot_legenditem.cpp:346
QwtPlotLegendItem::drawLegendData
virtual void drawLegendData(QPainter *, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const
Definition qwt_plot_legenditem.cpp:780
QwtPlotLegendItem::legendGeometries
QList< QRect > legendGeometries(const QwtPlotItem *) const
Definition qwt_plot_legenditem.cpp:895
QwtPlotLegendItem::setBackgroundBrush
void setBackgroundBrush(const QBrush &)
Set the background brush.
Definition qwt_plot_legenditem.cpp:509
QwtPlotLegendItem::setItemMargin
void setItemMargin(int)
Definition qwt_plot_legenditem.cpp:319
QwtPlotLegendItem::plotItems
QList< const QwtPlotItem * > plotItems() const
Definition qwt_plot_legenditem.cpp:886
QwtPlotLegendItem::setMaxColumns
void setMaxColumns(uint)
Limit the number of columns.
Definition qwt_plot_legenditem.cpp:238
QwtPlotLegendItem::itemSpacing
int itemSpacing() const
Definition qwt_plot_legenditem.cpp:363
QwtPlotLegendItem::setBorderPen
void setBorderPen(const QPen &)
Definition qwt_plot_legenditem.cpp:483
QwtPlotLegendItem::setSpacing
void setSpacing(int)
Set the spacing between the legend items.
Definition qwt_plot_legenditem.cpp:294
QwtPlotLegendItem::heightForWidth
virtual int heightForWidth(const QwtLegendData &, int width) const
Definition qwt_plot_legenditem.cpp:862
QwtPlotLegendItem::setFont
void setFont(const QFont &)
Definition qwt_plot_legenditem.cpp:374
QwtPlotLegendItem::borderPen
QPen borderPen() const
Definition qwt_plot_legenditem.cpp:496
QwtPlotLegendItem::minimumSize
virtual QSize minimumSize(const QwtLegendData &) const
Definition qwt_plot_legenditem.cpp:823
QwtPlotLegendItem::maxColumns
uint maxColumns() const
Definition qwt_plot_legenditem.cpp:251
QwtPlotLegendItem::drawBackground
virtual void drawBackground(QPainter *, const QRectF &rect) const
Definition qwt_plot_legenditem.cpp:630
QwtPlotLegendItem::rtti
virtual int rtti() const override
Definition qwt_plot_legenditem.cpp:192
QwtPlotLegendItem::clearLegend
void clearLegend()
Remove all items from the legend.
Definition qwt_plot_legenditem.cpp:759
QwtPlotLegendItem::~QwtPlotLegendItem
virtual ~QwtPlotLegendItem()
Destructor.
Definition qwt_plot_legenditem.cpp:185
QwtPlotLegendItem::margin
int margin() const
Definition qwt_plot_legenditem.cpp:280
QwtPlotLegendItem::textPen
QPen textPen() const
Definition qwt_plot_legenditem.cpp:574
QwtPlotLegendItem::setTextPen
void setTextPen(const QPen &)
Set the pen for drawing text labels.
Definition qwt_plot_legenditem.cpp:561
QwtPlotLegendItem::borderRadius
double borderRadius() const
Definition qwt_plot_legenditem.cpp:472
QwtPlotLegendItem::setBorderRadius
void setBorderRadius(double)
Definition qwt_plot_legenditem.cpp:457
QwtScaleMap
A scale map.
Definition qwt_scale_map.h:27
QwtText
A class representing a text.
Definition qwt_text.h:52
QwtText::textSize
QSizeF textSize() const
Definition qwt_text.cpp:570
QwtText::isEmpty
bool isEmpty() const
Definition qwt_text.cpp:739
QwtText::setFont
void setFont(const QFont &)
Definition qwt_text.cpp:329
QwtText::draw
void draw(QPainter *painter, const QRectF &rect) const
Definition qwt_text.cpp:615
QwtText::heightForWidth
double heightForWidth(double width) const
Definition qwt_text.cpp:522