qwt_plot_shapeitem.h
/******************************************************************************
* 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_SHAPE_ITEM_H
#define QWT_PLOT_SHAPE_ITEM_H
#include "qwt_global.h"
#include "qwt_plot_item.h"
#include <qstring.h>
class QPainterPath;
class QPolygonF;
class QWT_EXPORT QwtPlotShapeItem : public QwtPlotItem
{
public:
enum PaintAttribute
{
ClipPolygons = 0x01,
};
Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
enum LegendMode
{
LegendShape,
LegendColor
};
explicit QwtPlotShapeItem( const QString& title = QString() );
explicit QwtPlotShapeItem( const QwtText& title );
virtual ~QwtPlotShapeItem();
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
void setLegendMode( LegendMode );
LegendMode legendMode() const;
void setRect( const QRectF& );
void setPolygon( const QPolygonF& );
void setShape( const QPainterPath& );
QPainterPath shape() const;
void setPen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
void setPen( const QPen& );
QPen pen() const;
void setBrush( const QBrush& );
QBrush brush() const;
void setRenderTolerance( double );
double renderTolerance() const;
virtual QRectF boundingRect() const QWT_OVERRIDE;
virtual void draw( QPainter*,
const QwtScaleMap& xMap, const QwtScaleMap& yMap,
const QRectF& canvasRect ) const QWT_OVERRIDE;
virtual QwtGraphic legendIcon(
int index, const QSizeF& ) const QWT_OVERRIDE;
virtual int rtti() const QWT_OVERRIDE;
private:
void init();
class PrivateData;
PrivateData* m_data;
};
#endif
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:76
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:67
QwtPlotItem::boundingRect
virtual QRectF boundingRect() const
Definition: qwt_plot_item.cpp:568
QwtPlotShapeItem
A plot item, which displays any graphical shape, that can be defined by a QPainterPath.
Definition: qwt_plot_shapeitem.h:39
QwtPlotShapeItem::LegendMode
LegendMode
Mode how to display the item on the legend.
Definition: qwt_plot_shapeitem.h:65
QwtPlotShapeItem::LegendShape
@ LegendShape
Display a scaled down version of the shape.
Definition: qwt_plot_shapeitem.h:67
QwtPlotShapeItem::PaintAttribute
PaintAttribute
Definition: qwt_plot_shapeitem.h:48
QwtPlotShapeItem::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Definition: qwt_plot_shapeitem.h:61
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:27
QwtText
A class representing a text.
Definition: qwt_text.h:52