From c97104f31e23315807fe24f1424b99438f91e37a Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 15 Jun 2012 13:41:18 +0200 Subject: Analog clock and raster window examples Change-Id: I36586fbaa7da25208bbc1964d2708f094d0d5c98 Reviewed-by: Gunnar Sletta --- src/gui/doc/src/coordsys.qdoc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/gui/doc/src/coordsys.qdoc') diff --git a/src/gui/doc/src/coordsys.qdoc b/src/gui/doc/src/coordsys.qdoc index c0e33c974e..b4be1c0b27 100644 --- a/src/gui/doc/src/coordsys.qdoc +++ b/src/gui/doc/src/coordsys.qdoc @@ -230,14 +230,13 @@ \row \li {2,1} - \snippet widgets/analogclock/analogclock.cpp 9 + \snippet gui/analogclock/main.cpp 1 - First, we set up the painter. We translate the coordinate system - so that point (0, 0) is in the widget's center, instead of being - at the top-left corner. We also scale the system by \c side / 100, - where \c side is either the widget's width or the height, - whichever is shortest. We want the clock to be square, even if the - device isn't. + We translate the coordinate system so that point (0, 0) is in the + widget's center, instead of being at the top-left corner. We also + scale the system by \c side / 100, where \c side is either the + widget's width or the height, whichever is shortest. We want the + clock to be square, even if the device isn't. This will give us a 200 x 200 square area, with the origin (0, 0) in the center, that we can draw on. What we draw will show up in @@ -245,7 +244,7 @@ See also the \l {Window-Viewport Conversion} section. - \snippet widgets/analogclock/analogclock.cpp 18 + \snippet gui/analogclock/main.cpp 2 We draw the clock's hour hand by rotating the coordinate system and calling QPainter::drawConvexPolygon(). Thank's to the @@ -260,14 +259,14 @@ the code guarantees that the code that follows won't be disturbed by the transformations we've used. - \snippet widgets/analogclock/analogclock.cpp 24 + \snippet gui/analogclock/main.cpp 3 We do the same for the clock's minute hand, which is defined by the four points (1, 0), (0, 1), (-1, 0), and (0, -40). These coordinates specify a hand that is thinner and longer than the minute hand. - \snippet widgets/analogclock/analogclock.cpp 27 + \snippet gui/analogclock/main.cpp 4 Finally, we draw the clock face, which consists of twelve short lines at 30-degree intervals. At the end of that, the painter is @@ -440,9 +439,5 @@ \endtable \endomit - \sa {Analog Clock Example} + \sa {Analog Clock Window Example} */ - -/* - ### DOC-TODO: rewrite analog clock to be QWindow based - */ \ No newline at end of file -- cgit v1.2.3