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 #include <qpaintengine.h>
15 #include <qpixmap.h>
16 #include <qimage.h>
17 #include <qpolygon.h>
18 
19 class QPainterPath;
20 
31 {
32 public:
34  enum Type
35  {
37  Invalid = -1,
38 
41 
44 
47 
49  State
50  };
51 
53  struct PixmapData
54  {
55  QRectF rect;
56  QPixmap pixmap;
57  QRectF subRect;
58  };
59 
61  struct ImageData
62  {
63  QRectF rect;
64  QImage image;
65  QRectF subRect;
66  Qt::ImageConversionFlags flags;
67  };
68 
70  struct StateData
71  {
72  QPaintEngine::DirtyFlags flags;
73 
74  QPen pen;
75  QBrush brush;
76  QPointF brushOrigin;
78  Qt::BGMode backgroundMode;
79  QFont font;
80  QMatrix matrix;
81  QTransform transform;
82 
83  Qt::ClipOperation clipOperation;
84  QRegion clipRegion;
85  QPainterPath clipPath;
87 
88  QPainter::RenderHints renderHints;
89  QPainter::CompositionMode compositionMode;
90  qreal opacity;
91  };
92 
95 
96  explicit QwtPainterCommand( const QPainterPath & );
97 
98  QwtPainterCommand( const QRectF &rect,
99  const QPixmap &, const QRectF& subRect );
100 
101  QwtPainterCommand( const QRectF &rect,
102  const QImage &, const QRectF& subRect,
103  Qt::ImageConversionFlags );
104 
105  explicit QwtPainterCommand( const QPaintEngineState & );
106 
108 
109  QwtPainterCommand &operator=(const QwtPainterCommand & );
110 
111  Type type() const;
112 
113  QPainterPath *path();
114  const QPainterPath *path() const;
115 
116  PixmapData* pixmapData();
117  const PixmapData* pixmapData() const;
118 
119  ImageData* imageData();
120  const ImageData* imageData() const;
121 
122  StateData* stateData();
123  const StateData* stateData() const;
124 
125 private:
126  void copy( const QwtPainterCommand & );
127  void reset();
128 
130 
131  union
132  {
133  QPainterPath *d_path;
137  };
138 };
139 
142 {
143  return d_type;
144 }
145 
147 inline const QPainterPath *QwtPainterCommand::path() const
148 {
149  return d_path;
150 }
151 
153 inline const QwtPainterCommand::PixmapData*
155 {
156  return d_pixmapData;
157 }
158 
160 inline const QwtPainterCommand::ImageData *
162 {
163  return d_imageData;
164 }
165 
167 inline const QwtPainterCommand::StateData *
169 {
170  return d_stateData;
171 }
172 
173 #endif
Qt::ImageConversionFlags flags
Attributes how to paint a QPixmap.
#define QWT_EXPORT
Definition: qwt_global.h:38
QPainter::CompositionMode compositionMode
GraphId path[kMaxDeadlockPathLen]
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 Sat Jul 6 2019 03:44:17