qwt_graphic.h
Go to the documentation of this file.
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_GRAPHIC_H
11 #define QWT_GRAPHIC_H
12 
13 #include "qwt_global.h"
14 #include "qwt_null_paintdevice.h"
15 #include <qmetatype.h>
16 #include <qimage.h>
17 #include <qpixmap.h>
18 
19 class QwtPainterCommand;
20 
75 {
76 public:
82  {
95  RenderPensUnscaled = 0x1
96  };
97 
103  typedef QFlags<RenderHint> RenderHints;
104 
105  QwtGraphic();
106  QwtGraphic( const QwtGraphic & );
107 
108  virtual ~QwtGraphic();
109 
110  QwtGraphic& operator=( const QwtGraphic & );
111 
112  void reset();
113 
114  bool isNull() const;
115  bool isEmpty() const;
116 
117  void render( QPainter * ) const;
118 
119  void render( QPainter *, const QSizeF &,
120  Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
121 
122  void render( QPainter *, const QRectF &,
123  Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
124 
125  void render( QPainter *, const QPointF &,
126  Qt::Alignment = Qt::AlignTop | Qt::AlignLeft ) const;
127 
128  QPixmap toPixmap() const;
129  QPixmap toPixmap( const QSize &,
130  Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
131 
132  QImage toImage() const;
133  QImage toImage( const QSize &,
134  Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const;
135 
136  QRectF scaledBoundingRect( double sx, double sy ) const;
137 
138  QRectF boundingRect() const;
139  QRectF controlPointRect() const;
140 
141  const QVector< QwtPainterCommand > &commands() const;
142  void setCommands( QVector< QwtPainterCommand > & );
143 
144  void setDefaultSize( const QSizeF & );
145  QSizeF defaultSize() const;
146 
147  void setRenderHint( RenderHint, bool on = true );
148  bool testRenderHint( RenderHint ) const;
149 
150 protected:
151  virtual QSize sizeMetrics() const;
152 
153  virtual void drawPath( const QPainterPath & );
154 
155  virtual void drawPixmap( const QRectF &,
156  const QPixmap &, const QRectF & );
157 
158  virtual void drawImage( const QRectF &,
159  const QImage &, const QRectF &, Qt::ImageConversionFlags );
160 
161  virtual void updateState( const QPaintEngineState &state );
162 
163 private:
164  void updateBoundingRect( const QRectF & );
165  void updateControlPointRect( const QRectF & );
166 
167  class PathInfo;
168 
169  class PrivateData;
171 };
172 
173 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtGraphic::RenderHints )
174 Q_DECLARE_METATYPE( QwtGraphic )
175 
176 #endif
#define QWT_EXPORT
Definition: qwt_global.h:38
A null paint device doing nothing.
QFlags< RenderHint > RenderHints
Render hints.
Definition: qwt_graphic.h:103
virtual void drawPath(const QPainterPath &)
See QPaintEngine::drawPath()
virtual void updateState(const QPaintEngineState &state)
See QPaintEngine::updateState()
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
PrivateData * d_data
Definition: qwt_graphic.h:169
virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags)
See QPaintEngine::drawImage()
virtual QSize sizeMetrics() const =0
virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &)
See QPaintEngine::drawPixmap()


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17