qwt_plot_legenditem.h
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* 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
*****************************************************************************/
#ifndef QWT_PLOT_LEGEND_ITEM_H
#define QWT_PLOT_LEGEND_ITEM_H
#include "qwt_global.h"
#include "qwt_plot_item.h"
#include "qwt_legend_data.h"
class QFont;
class QWT_EXPORT QwtPlotLegendItem: public QwtPlotItem
{
public:
enum BackgroundMode
{
LegendBackground,
ItemBackground
};
explicit QwtPlotLegendItem();
virtual ~QwtPlotLegendItem();
virtual int rtti() const;
void setAlignment( Qt::Alignment );
Qt::Alignment alignment() const;
void setMaxColumns( uint );
uint maxColumns() const;
void setMargin( int );
int margin() const;
void setSpacing( int );
int spacing() const;
void setItemMargin( int );
int itemMargin() const;
void setItemSpacing( int );
int itemSpacing() const;
void setFont( const QFont& );
QFont font() const;
void setBorderDistance( int );
int borderDistance() const;
void setBorderRadius( double );
double borderRadius() const;
void setBorderPen( const QPen & );
QPen borderPen() const;
void setBackgroundBrush( const QBrush & );
QBrush backgroundBrush() const;
void setBackgroundMode( BackgroundMode );
BackgroundMode backgroundMode() const;
void setTextPen( const QPen & );
QPen textPen() const;
virtual void draw( QPainter *,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF &canvasRect ) const;
void clearLegend();
virtual void updateLegend( const QwtPlotItem *,
const QList<QwtLegendData> & );
virtual QRect geometry( const QRectF &canvasRect ) const;
virtual QSize minimumSize( const QwtLegendData & ) const;
virtual int heightForWidth( const QwtLegendData &, int width ) const;
QList< const QwtPlotItem * > plotItems() const;
QList< QRect > legendGeometries( const QwtPlotItem * ) const;
protected:
virtual void drawLegendData( QPainter *painter,
const QwtPlotItem *, const QwtLegendData &, const QRectF & ) const;
virtual void drawBackground( QPainter *, const QRectF &rect ) const;
private:
class PrivateData;
PrivateData *d_data;
};
#endif
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:36
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:65
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:120
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:31
QwtPlotLegendItem::BackgroundMode
BackgroundMode
Background mode.
Definition: qwt_plot_legenditem.h:56
QwtPlotLegendItem
A class which draws a legend inside the plot canvas.
Definition: qwt_plot_legenditem.h:43
QwtPlotItem::updateLegend
virtual void updateLegend(const QwtPlotItem *, const QList< QwtLegendData > &)
Update the item to changes of the legend info.
Definition: qwt_plot_item.cpp:661
QwtPlotLegendItem::LegendBackground
@ LegendBackground
The legend has a background.
Definition: qwt_plot_legenditem.h:58
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.