1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the documentation of the Qt Toolkit.
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.
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.
26 ****************************************************************************/
29 \example painting/gradients
31 \ingroup examples-painting
32 \brief Shows how gradients can be used with QPainter.
34 \brief In this example we show the various types of gradients that can
37 \image gradients-demo.png
39 There are three types of gradients:
42 \li \b{Linear} gradients interpolate colors between start and end points.
43 \li \b{Radial} gradients interpolate colors between a focal point and the
44 points on a circle surrounding it.
45 \li \b{Conical} gradients interpolate colors around a center point.
48 The panel on the right contains a color table editor that defines
49 the colors in the gradient. The three topmost controls determine the red,
50 green and blue components while the last defines the alpha of the
51 gradient. You can move points, and add new ones, by clicking with the left
52 mouse button, and remove points by clicking with the right button.
54 There are three default configurations available at the bottom of
55 the page that are provided as suggestions on how a color table could be