Qwt User's Guide 6.3.0
Loading...
Searching...
No Matches
qwt_plot_shapeitem.h
1/******************************************************************************
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
16#include <qstring.h>
17
18class QPainterPath;
19class QPolygonF;
20
38class QWT_EXPORT QwtPlotShapeItem : public QwtPlotItem
39{
40 public:
48 {
58 ClipPolygons = 0x01,
59 };
60
61 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
62
63
65 {
68
70 LegendColor
71 };
72
73 explicit QwtPlotShapeItem( const QString& title = QString() );
74 explicit QwtPlotShapeItem( const QwtText& title );
75
76 virtual ~QwtPlotShapeItem();
77
78 void setPaintAttribute( PaintAttribute, bool on = true );
79 bool testPaintAttribute( PaintAttribute ) const;
80
81 void setLegendMode( LegendMode );
82 LegendMode legendMode() const;
83
84 void setRect( const QRectF& );
85 void setPolygon( const QPolygonF& );
86
87 void setShape( const QPainterPath& );
88 QPainterPath shape() const;
89
90 void setPen( const QColor&, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
91 void setPen( const QPen& );
92 QPen pen() const;
93
94 void setBrush( const QBrush& );
95 QBrush brush() const;
96
97 void setRenderTolerance( double );
98 double renderTolerance() const;
99
100 virtual QRectF boundingRect() const QWT_OVERRIDE;
101
102 virtual void draw( QPainter*,
103 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
104 const QRectF& canvasRect ) const QWT_OVERRIDE;
105
106 virtual QwtGraphic legendIcon(
107 int index, const QSizeF& ) const QWT_OVERRIDE;
108
109 virtual int rtti() const QWT_OVERRIDE;
110
111 private:
112 void init();
113
114 class PrivateData;
115 PrivateData* m_data;
116};
117
118#endif
A paint device for scalable graphics.
Definition qwt_graphic.h:76
Base class for items on the plot canvas.
virtual QRectF boundingRect() const
A plot item, which displays any graphical shape, that can be defined by a QPainterPath.
LegendMode
Mode how to display the item on the legend.
@ LegendShape
Display a scaled down version of the shape.
QFlags< PaintAttribute > PaintAttributes
A scale map.
A class representing a text.
Definition qwt_text.h:52