Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_graphic.h
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_graphic.h
r8127 r9383 37 37 - QSvgRenderer/QSvgGenerator\n 38 38 Unfortunately QSvgRenderer hides to much information about 39 its nodes in internal APIs, that are necessary for proper 40 layout calculations. Also it is derived from QObject and 39 its nodes in internal APIs, that are necessary for proper 40 layout calculations. Also it is derived from QObject and 41 41 can't be copied like QImage/QPixmap. 42 42 43 43 QwtGraphic maps all scalable drawing primitives to a QPainterPath 44 and stores them together with the painter state changes 45 ( pen, brush, transformation ... ) in a list of QwtPaintCommands. 46 For being a complete QPaintDevice it also stores pixmaps or images, 47 what is somehow against the idea of the class, because these objects 44 and stores them together with the painter state changes 45 ( pen, brush, transformation ... ) in a list of QwtPaintCommands. 46 For being a complete QPaintDevice it also stores pixmaps or images, 47 what is somehow against the idea of the class, because these objects 48 48 can't be scaled without a loss in quality. 49 49 50 50 The main issue about scaling a QwtGraphic object are the pens used for 51 drawing the outlines of the painter paths. While non cosmetic pens 52 ( QPen::isCosmetic() ) are scaled with the same ratio as the path, 53 cosmetic pens have a fixed width. A graphic might have paths with 51 drawing the outlines of the painter paths. While non cosmetic pens 52 ( QPen::isCosmetic() ) are scaled with the same ratio as the path, 53 cosmetic pens have a fixed width. A graphic might have paths with 54 54 different pens - cosmetic and non-cosmetic. 55 55 … … 58 58 - control point rectangle\n 59 59 The control point rectangle is the bounding rectangle of all 60 control point rectangles of the painter paths, or the target 60 control point rectangles of the painter paths, or the target 61 61 rectangle of the pixmaps/images. 62 62 … … 65 65 what is needed for rendering the outline with an unscaled pen. 66 66 67 Because the offset for drawing the outline depends on the shape 68 of the painter path ( the peak of a triangle is different than the flat side ) 69 scaling with a fixed aspect ratio always needs to be calculated from the 67 Because the offset for drawing the outline depends on the shape 68 of the painter path ( the peak of a triangle is different than the flat side ) 69 scaling with a fixed aspect ratio always needs to be calculated from the 70 70 control point rectangle. 71 71 … … 75 75 { 76 76 public: 77 /*! 77 /*! 78 78 Hint how to render a graphic 79 79 \sa setRenderHint(), testRenderHint() … … 82 82 { 83 83 /*! 84 When rendering a QwtGraphic a specific scaling between 84 When rendering a QwtGraphic a specific scaling between 85 85 the controlPointRect() and the coordinates of the target rectangle 86 86 is set up internally in render(). … … 96 96 }; 97 97 98 /*! 98 /*! 99 99 \brief Render hints 100 100 … … 117 117 void render( QPainter * ) const; 118 118 119 void render( QPainter *, const QSizeF &, 119 void render( QPainter *, const QSizeF &, 120 120 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 121 121 122 void render( QPainter *, const QRectF &, 122 void render( QPainter *, const QRectF &, 123 123 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 124 124 … … 126 126 Qt::Alignment = Qt::AlignTop | Qt::AlignLeft ) const; 127 127 128 QPixmap toPixmap() const; 129 QPixmap toPixmap( const QSize &, 128 QPixmap toPixmap() const; 129 QPixmap toPixmap( const QSize &, 130 130 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 131 131 132 QImage toImage() const; 133 QImage toImage( const QSize &, 132 QImage toImage() const; 133 QImage toImage( const QSize &, 134 134 Qt::AspectRatioMode = Qt::IgnoreAspectRatio ) const; 135 135 … … 144 144 void setDefaultSize( const QSizeF & ); 145 145 QSizeF defaultSize() const; 146 146 147 147 void setRenderHint( RenderHint, bool on = true ); 148 148 bool testRenderHint( RenderHint ) const;
Note:
See TracChangeset
for help on using the changeset viewer.