diff options
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r-- | examples/widgets/doc/src/painterpaths.qdoc | 11 | ||||
-rw-r--r-- | examples/widgets/doc/src/tablet.qdoc | 13 |
2 files changed, 13 insertions, 11 deletions
diff --git a/examples/widgets/doc/src/painterpaths.qdoc b/examples/widgets/doc/src/painterpaths.qdoc index 2cc5ff410a..bd821ac1bf 100644 --- a/examples/widgets/doc/src/painterpaths.qdoc +++ b/examples/widgets/doc/src/painterpaths.qdoc @@ -98,14 +98,9 @@ \section1 Window Class Implementation - In the implementation of the \c Window class we first declare the - constant \c Pi with six significant figures: - - \snippet painting/painterpaths/window.cpp 0 - - In the constructor, we then define the various painter paths and - create corresponding \c RenderArea widgets which will render the - graphical shapes: + In the \c Window constructor, we define the various painter paths + and create corresponding \c RenderArea widgets which will render + the graphical shapes: \snippet painting/painterpaths/window.cpp 1 diff --git a/examples/widgets/doc/src/tablet.qdoc b/examples/widgets/doc/src/tablet.qdoc index 88fdefa68f..2b11020c07 100644 --- a/examples/widgets/doc/src/tablet.qdoc +++ b/examples/widgets/doc/src/tablet.qdoc @@ -206,8 +206,7 @@ \snippet widgets/tablet/tabletcanvas.cpp 0 - In the constructor we initialize our class variables. We need - to draw the background of our pixmap, as the default is gray. + In the constructor we initialize most of our class variables. Here is the implementation of \c saveImage(): @@ -247,7 +246,15 @@ \snippet widgets/tablet/tabletcanvas.cpp 4 - We simply draw the pixmap to the top left of the widget. + The first time Qt calls paintEvent(), m_pixmap is default-constructed, so + QPixmap::isNull() returns \c true. Now that we know which screen we will be + rendering to, we can create a pixmap with the appropriate resolution. + The size of the pixmap with which we fill the window depends on the screen + resolution, as the example does not support zoom; and it may be that one + screen is \l {High DPI Displays}{high DPI} while another is not. We need to + draw the background too, as the default is gray. + + After that, we simply draw the pixmap to the top left of the widget. Here is the implementation of \c paintPixmap(): |