diff options
Diffstat (limited to 'examples/widgets/doc/src')
-rw-r--r-- | examples/widgets/doc/src/analogclock.qdoc | 9 | ||||
-rw-r--r-- | examples/widgets/doc/src/basicdrawing.qdoc | 10 | ||||
-rw-r--r-- | examples/widgets/doc/src/transformations.qdoc | 12 |
3 files changed, 14 insertions, 17 deletions
diff --git a/examples/widgets/doc/src/analogclock.qdoc b/examples/widgets/doc/src/analogclock.qdoc index 8f98f4b7b08..aeaddd4b936 100644 --- a/examples/widgets/doc/src/analogclock.qdoc +++ b/examples/widgets/doc/src/analogclock.qdoc @@ -106,11 +106,10 @@ system counterclockwise by a number of degrees determined by the current hour and minute. This means that the hand will be shown rotated clockwise by the required amount. - We save and restore the transformation matrix before and after the - rotation because we want to place the minute hand without having to - take into account any previous rotations. + We save and restore the transformation matrix before and after the rotation + by instantiating a QPainterStateGuard because we want to place the minute + hand without having to take into account any previous rotations. - \snippet widgets/analogclock/analogclock.cpp 17 \snippet widgets/analogclock/analogclock.cpp 19 We draw markers around the edge of the clock for each hour in the same @@ -123,7 +122,7 @@ \snippet widgets/analogclock/analogclock.cpp 21 - For the seconds hand we do the same and add two cicles as a visual highlight. + For the seconds hand we do the same and add two circles as a visual highlight. \snippet widgets/analogclock/analogclock.cpp 23 \codeline diff --git a/examples/widgets/doc/src/basicdrawing.qdoc b/examples/widgets/doc/src/basicdrawing.qdoc index 0882c0f32f3..a4606a29814 100644 --- a/examples/widgets/doc/src/basicdrawing.qdoc +++ b/examples/widgets/doc/src/basicdrawing.qdoc @@ -370,8 +370,8 @@ RenderArea widget, and we calculate their positions using two \c for loops and the widgets height and width. - For each copy we first save the current painter state (pushes the - state onto a stack). Then we translate the coordinate system, + For each copy we first save the current painter state by instantiating + a QPainterStateGuard. Then we translate the coordinate system, using the QPainter::translate() function, to the position determined by the variables of the \c for loops. If we omit this translation of the coordinate system all the copies of the shape @@ -420,9 +420,9 @@ \snippet painting/basicdrawing/renderarea.cpp 13 - Then, when we are finished rendering a copy of the shape we can - restore the original painter state, with its associated coordinate - system, using the QPainter::restore() function. In this way we + Then, when we are finished rendering a copy of the shape, + the original painter state is restored by QPainterStateGuard, + which calls the QPainter::restore() function. In this way, we ensure that the next shape copy will be rendered in the correct position. diff --git a/examples/widgets/doc/src/transformations.qdoc b/examples/widgets/doc/src/transformations.qdoc index d90708340c1..f8a29407c83 100644 --- a/examples/widgets/doc/src/transformations.qdoc +++ b/examples/widgets/doc/src/transformations.qdoc @@ -161,13 +161,11 @@ \snippet painting/transformations/renderarea.cpp 6 - Before we start to render the shape, we call the QPainter::save() - function. - - QPainter::save() saves the current painter state (i.e. pushes the - state onto a stack) including the current coordinate system. The - rationale for saving the painter state is that the following call - to the \c transformPainter() function will transform the + Before we start to render the shape, we instantiate + a QPainterStateGuard to save the current painter state (i.e. push the + state onto a stack) including the current coordinate system while + in scope. The rationale for saving the painter state is that the + following call to the \c transformPainter() function will transform the coordinate system depending on the currently chosen transformation operations, and we need a way to get back to the original state to draw the outline. |