742f5528f97e8b2e05b5226c31e759f774828299
[profile/ivi/qtbase.git] / examples / widgets / doc / src / deform.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.  For licensing terms and
14 ** conditions see http://qt.digia.com/licensing.  For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Free Documentation License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Free
19 ** Documentation License version 1.3 as published by the Free Software
20 ** Foundation and appearing in the file included in the packaging of
21 ** this file.  Please review the following information to ensure
22 ** the GNU Free Documentation License version 1.3 requirements
23 ** will be met: http://www.gnu.org/copyleft/fdl.html.
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29     \example painting/deform
30     \title Vector Deformation
31
32     \brief This example shows how to use advanced vector techniques to draw text
33     using a \c QPainterPath.
34
35     \image deform-demo.png
36
37     We define a vector deformation field in the shape of a lens and apply
38     this to all points in a path. This means that what is rendered on
39     screen is not pixel manipulation, but modified vector representations of
40     the glyphs themselves. This is visible from the high quality of the
41     antialiased edges for the deformed glyphs.
42
43     To get a fairly complex path we allow the user to type in text and
44     convert the text to paths. This is done using the
45     QPainterPath::addText() function.
46
47     The lens is drawn using a single call to QPainter::drawEllipse(),
48     using a QRadialGradient to fill it with a specialized color
49     table, giving the effect of the sun's reflection and a drop
50     shadow. The lens is cached as a pixmap for better performance.
51 */