| qwt_graphic.h | | qwt_graphic.h | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| #include <qimage.h> | | #include <qimage.h> | |
| #include <qpixmap.h> | | #include <qpixmap.h> | |
| | | | |
| class QwtPainterCommand; | | class QwtPainterCommand; | |
| | | | |
| /*! | | /*! | |
| \brief A paint device for scalable graphics | | \brief A paint device for scalable graphics | |
| | | | |
| QwtGraphic is the representation of a graphic that is tailored for | | QwtGraphic is the representation of a graphic that is tailored for | |
| scalability. Like QPicture it will be initialized by QPainter | | scalability. Like QPicture it will be initialized by QPainter | |
|
| operations and replayed later to any target paint device. | | operations and can be replayed later to any target paint device. | |
| | | | |
| While the usual image representations QImage and QPixmap are not | | While the usual image representations QImage and QPixmap are not | |
| scalable Qt offers two paint devices, that might be candidates | | scalable Qt offers two paint devices, that might be candidates | |
| for representing a vector graphic: | | for representing a vector graphic: | |
| | | | |
| - QPicture\n | | - QPicture\n | |
| Unfortunately QPicture had been forgotten, when Qt4 | | Unfortunately QPicture had been forgotten, when Qt4 | |
| introduced floating point based render engines. Its API | | introduced floating point based render engines. Its API | |
| is still on integers, what make it unusable for proper scaling. | | is still on integers, what make it unusable for proper scaling. | |
| | | | |
| - QSvgRenderer/QSvgGenerator\n | | - QSvgRenderer/QSvgGenerator\n | |
| Unfortunately QSvgRenderer hides to much information about | | Unfortunately QSvgRenderer hides to much information about | |
|
| its nodes in internal APIs, that are necessary proper | | its nodes in internal APIs, that are necessary for proper | |
| layout calculations. Also it is derived from QObject and | | layout calculations. Also it is derived from QObject and | |
| can't be copied like QImage/QPixmap. | | can't be copied like QImage/QPixmap. | |
|
| Also QSvgRenderer/QSvgGenerator are no complete SVG implementations | | | |
| with a questionable future in Qt 5. | | | |
| | | | |
| QwtGraphic maps all scalable drawing primitives to a QPainterPath | | QwtGraphic maps all scalable drawing primitives to a QPainterPath | |
| and stores them together with the painter state changes | | and stores them together with the painter state changes | |
| ( pen, brush, transformation ... ) in a list of QwtPaintCommands. | | ( pen, brush, transformation ... ) in a list of QwtPaintCommands. | |
| For being a complete QPaintDevice it also stores pixmaps or images, | | For being a complete QPaintDevice it also stores pixmaps or images, | |
| what is somehow against the idea of the class, because these objects | | what is somehow against the idea of the class, because these objects | |
|
| can be scaled without a loss in quality. | | can't be scaled without a loss in quality. | |
| | | | |
| The main issue about scaling a QwtGraphic object are the pens used for | | The main issue about scaling a QwtGraphic object are the pens used for | |
| drawing the outlines of the painter paths. While non cosmetic pens | | drawing the outlines of the painter paths. While non cosmetic pens | |
| ( QPen::isCosmetic() ) are scaled with the same ratio as the path, | | ( QPen::isCosmetic() ) are scaled with the same ratio as the path, | |
| cosmetic pens have a fixed width. A graphic might have paths with | | cosmetic pens have a fixed width. A graphic might have paths with | |
| different pens - cosmetic and non-cosmetic. | | different pens - cosmetic and non-cosmetic. | |
| | | | |
| QwtGraphic caches 2 different rectangles: | | QwtGraphic caches 2 different rectangles: | |
| | | | |
| - control point rectangle\n | | - control point rectangle\n | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 84 | |
| class QWT_EXPORT QwtGraphic: public QwtNullPaintDevice | | class QWT_EXPORT QwtGraphic: public QwtNullPaintDevice | |
| { | | { | |
| public: | | public: | |
| /*! | | /*! | |
| Hint how to render a graphic | | Hint how to render a graphic | |
| \sa setRenderHint(), testRenderHint() | | \sa setRenderHint(), testRenderHint() | |
| */ | | */ | |
| enum RenderHint | | enum RenderHint | |
| { | | { | |
| /*! | | /*! | |
|
| When RenderPensUnscaled is set non cosmetic pens are | | When rendering a QwtGraphic a specific scaling between | |
| painted unscaled - like cosmetic pens. The difference to | | the controlPointRect() and the coordinates of the target rectang | |
| using cosmetic pens is, when the graphic is rendered | | le | |
| to a document in a scalable vector format ( PDF, SVG ): | | is set up internally in render(). | |
| the width of non cosmetic pens will be scaled by the | | | |
| document viewer. | | When RenderPensUnscaled is set this specific scaling is applied | |
| | | for the control points only, but not for the pens. | |
| | | All other painter transformations ( set up by application code ) | |
| | | are supposed to work like usual. | |
| | | | |
| | | \sa render(); | |
| */ | | */ | |
| RenderPensUnscaled = 0x1 | | RenderPensUnscaled = 0x1 | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| \brief Render hints | | \brief Render hints | |
| | | | |
| The default setting is to disable all hints | | The default setting is to disable all hints | |
| */ | | */ | |
| typedef QFlags<RenderHint> RenderHints; | | typedef QFlags<RenderHint> RenderHints; | |
| | | | |
End of changes. 5 change blocks. |
| 11 lines changed or deleted | | 14 lines changed or added | |
|