diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2012-06-15 13:41:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-13 09:55:18 +0200 |
commit | c97104f31e23315807fe24f1424b99438f91e37a (patch) | |
tree | 7df81945e503b5eae86aa8c21b633ca7716984f4 /src/gui/doc/src | |
parent | d472db241215326dcc031db3329497fefa1ec800 (diff) |
Analog clock and raster window examples
Change-Id: I36586fbaa7da25208bbc1964d2708f094d0d5c98
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/doc/src')
-rw-r--r-- | src/gui/doc/src/coordsys.qdoc | 25 | ||||
-rw-r--r-- | src/gui/doc/src/qtgui.qdoc | 22 |
2 files changed, 17 insertions, 30 deletions
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 diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc index 64d9cb67fd..0421b172cf 100644 --- a/src/gui/doc/src/qtgui.qdoc +++ b/src/gui/doc/src/qtgui.qdoc @@ -63,9 +63,10 @@ For application developers writing user interfaces, Qt provides higher level API's, like Qt Quick, that are much more suitable than the enablers found in the Qt GUI module. + than the enablers found in the Qt GUI module. + - \section1 Application Windows The most important classes in the Qt GUI module are @@ -73,7 +74,7 @@ content on screen, will need to make use of these. QGuiApplication contains the main event loop, where all events from the window system and other sources are processed and dispatched. It also - handles the application's initialization and finalization. + handles the application's initialization and finalization. The \l QWindow class represents a window in the underlying windowing system. It provides a number of virtual functions to @@ -83,16 +84,16 @@ \section1 2D Graphics - + The Qt GUI module contains classes for 2D graphics, imaging, fonts and advanced typography. - + A \l QWindow created with the surface type \l {QSurface::RasterSurface} can be used in combination with \l {QBackingStore} and \l {QPainter}, Qt's highly optimized 2D vector graphics API. QPainter supports drawing lines, polygons, vector paths, images and text. For more information, see \l{Paint - System}. + System} and \l {Raster Window Example}. Qt can load and save images using the \l QImage and \l QPixmap classes. By default, Qt supports the most common image formats @@ -109,7 +110,7 @@ \section1 OpenGL and OpenGL ES integration - + QWindow supports rendering using desktop OpenGL, OpenGL ES 1.1 and OpenGL ES 2.0, depending on what the platform supports. OpenGL rendering is enabled by setting the QWindow's surface type to @@ -126,7 +127,6 @@ be used in combination with \l QPainter and \l QOpenGLPaintDevice to have OpenGL hardware accellerated 2D graphics, by sacrificing some of the visual quality. - @@ -148,14 +148,6 @@ /* - ### DOC-TODO: link under AppWindows to hello-world for QWindow in - examples/gui/windows/hello-qtgui. (Idea: QWindow which - reimplements mouseEvent() to exit) - - ### DOC-TODO: link under Painting to hello-raster for QWindow - in examples/gui/graphics/rasterwindow. Idea: QWindow with BS - which draws a rotating rectangle with some text underneath. - ### DOC-TODO: link under OpenGL to hello-opengl for QWindow in examples/gui/opengl/openglwindow. Idea: QWindow which draws a triangle using GLES 2.0 compatible shaders. Do not care about |