Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
gradientcreationsnippet.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QBrush>
5
7
8void wrapper() {
9
11 QRadialGradient gradient(50, 50, 50, 50, 50);
12 gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
13 gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
14
15 QBrush brush(gradient);
17
18} // wrapper
19
20} // gradientcreationsnippet
\inmodule QtGui
Definition qbrush.h:30
static QColor fromRgbF(float r, float g, float b, float a=1.0)
Static convenience function that returns a QColor constructed from the RGB color values,...
Definition qcolor.cpp:2427
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
Definition qbrush.cpp:1563
\inmodule QtGui
Definition qbrush.h:412
Definition brush.cpp:5