qwt_painter_command.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_PAINTER_COMMAND_H
11 #define QWT_PAINTER_COMMAND_H
12 
13 #include "qwt_global.h"
14 
15 #include <qpaintengine.h>
16 #include <qpixmap.h>
17 #include <qimage.h>
18 #include <qpolygon.h>
19 #include <qpainterpath.h>
20 
21 class QPainterPath;
22 
33 {
34 public:
36  enum Type
37  {
39  Invalid = -1,
40 
43 
46 
49 
51  State
52  };
53 
55  struct PixmapData
56  {
57  QRectF rect;
58  QPixmap pixmap;
59  QRectF subRect;
60  };
61 
63  struct ImageData
64  {
65  QRectF rect;
66  QImage image;
67  QRectF subRect;
68  Qt::ImageConversionFlags flags;
69  };
70 
72  struct StateData
73  {
74  QPaintEngine::DirtyFlags flags;
75 
76  QPen pen;
77  QBrush brush;
78  QPointF brushOrigin;
80  Qt::BGMode backgroundMode;
81  QFont font;
82  QMatrix matrix;
83  QTransform transform;
84 
85  Qt::ClipOperation clipOperation;
86  QRegion clipRegion;
87  QPainterPath clipPath;
89 
90  QPainter::RenderHints renderHints;
91  QPainter::CompositionMode compositionMode;
92  qreal opacity;
93  };
94 
97 
98  explicit QwtPainterCommand( const QPainterPath & );
99 
100  QwtPainterCommand( const QRectF &rect,
101  const QPixmap &, const QRectF& subRect );
102 
103  QwtPainterCommand( const QRectF &rect,
104  const QImage &, const QRectF& subRect,
105  Qt::ImageConversionFlags );
106 
107  explicit QwtPainterCommand( const QPaintEngineState & );
108 
110 
111  QwtPainterCommand &operator=(const QwtPainterCommand & );
112 
113  Type type() const;
114 
115  QPainterPath *path();
116  const QPainterPath *path() const;
117 
118  PixmapData* pixmapData();
119  const PixmapData* pixmapData() const;
120 
121  ImageData* imageData();
122  const ImageData* imageData() const;
123 
124  StateData* stateData();
125  const StateData* stateData() const;
126 
127 private:
128  void copy( const QwtPainterCommand & );
129  void reset();
130 
132 
133  union
134  {
135  QPainterPath *d_path;
139  };
140 };
141 
144 {
145  return d_type;
146 }
147 
149 inline const QPainterPath *QwtPainterCommand::path() const
150 {
151  return d_path;
152 }
153 
155 inline const QwtPainterCommand::PixmapData *
157 {
158  return d_pixmapData;
159 }
160 
162 inline const QwtPainterCommand::ImageData *
164 {
165  return d_imageData;
166 }
167 
169 inline const QwtPainterCommand::StateData *
171 {
172  return d_stateData;
173 }
174 
175 #endif
Qt::ImageConversionFlags flags
Attributes how to paint a QPixmap.
#define QWT_EXPORT
Definition: qwt_global.h:38
QPainter::CompositionMode compositionMode
Type
Type of the paint command.
QPainter::RenderHints renderHints
Draw a QPainterPath.
Attributes of a state change.
QPaintEngine::DirtyFlags flags
Attributes how to paint a QImage.


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10