Qwt User's Guide: qwt_plot_shapeitem.h Source File

Qwt User's Guide 6.1.4

qwt_plot_shapeitem.h
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10 #ifndef QWT_PLOT_SHAPE_ITEM_H
11 #define QWT_PLOT_SHAPE_ITEM_H
12
13 #include "qwt_global.h"
14 #include "qwt_plot_item.h"
15 #include <qpainterpath.h>
16
31 class QWT_EXPORT QwtPlotShapeItem: public QwtPlotItem
32 {
33 public:
40 enum PaintAttribute
41 {
51 ClipPolygons = 0x01,
52 };
53
55 typedef QFlags<PaintAttribute> PaintAttributes;
56
58 enum LegendMode
59 {
61 LegendShape,
62
64 LegendColor
65 };
66
67 explicit QwtPlotShapeItem( const QString &title = QString() );
68 explicit QwtPlotShapeItem( const QwtText &title );
69
70 virtual ~QwtPlotShapeItem();
71
72 void setPaintAttribute( PaintAttribute, bool on = true );
73 bool testPaintAttribute( PaintAttribute ) const;
74
75 void setLegendMode( LegendMode );
76 LegendMode legendMode() const;
77
78 void setRect( const QRectF & );
79 void setPolygon( const QPolygonF & );
80
81 void setShape( const QPainterPath & );
82 QPainterPath shape() const;
83
84 void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
85 void setPen( const QPen & );
86 QPen pen() const;
87
88 void setBrush( const QBrush & );
89 QBrush brush() const;
90
91 void setRenderTolerance( double );
92 double renderTolerance() const;
93
94 virtual QRectF boundingRect() const;
95
96 virtual void draw( QPainter *,
97 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
98 const QRectF &canvasRect ) const;
99
100 virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
101
102 virtual int rtti() const;
103
104 private:
105 void init();
106
107 class PrivateData;
108 PrivateData *d_data;
109 };
110
111 #endif
QwtPlotItem::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
Draw the item.
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:64
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:30
QwtPlotShapeItem::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
Definition: qwt_plot_shapeitem.h:55
QwtPlotShapeItem
A plot item, which displays any graphical shape, that can be defined by a QPainterPath.
Definition: qwt_plot_shapeitem.h:31
QwtPlotShapeItem::LegendMode
LegendMode
Mode how to display the item on the legend.
Definition: qwt_plot_shapeitem.h:58
QwtPlotItem::legendIcon
virtual QwtGraphic legendIcon(int index, const QSizeF &) const
Definition: qwt_plot_item.cpp:371
QwtPlotItem::boundingRect
virtual QRectF boundingRect() const
Definition: qwt_plot_item.cpp:537
QwtPlotShapeItem::PaintAttribute
PaintAttribute
Definition: qwt_plot_shapeitem.h:40
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
QwtPlotItem::rtti
virtual int rtti() const
Definition: qwt_plot_item.cpp:120
QwtPlotShapeItem::LegendShape
Display a scaled down version of the shape.
Definition: qwt_plot_shapeitem.h:61