summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/brush/gradientcreationsnippet.cpp
blob: 5f98df40f0c8b584f869195cbe347db3f0985761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include <QBrush>

namespace gradientcreationsnippet {

void wrapper() {

//! [0]
    QRadialGradient gradient(50, 50, 50, 50, 50);
    gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
    gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));

    QBrush brush(gradient);
//! [0]

} // wrapper

} // gradientcreationsnippet