Qt
6.x
The Qt SDK
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
6
namespace
gradientcreationsnippet
{
7
8
void
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
QBrush
\inmodule QtGui
Definition
qbrush.h:30
QColor::fromRgbF
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
QGradient::setColorAt
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
Definition
qbrush.cpp:1563
QRadialGradient
\inmodule QtGui
Definition
qbrush.h:412
brush
Definition
brush.cpp:5
gradientcreationsnippet
Definition
gradientcreationsnippet.cpp:6
gradientcreationsnippet::wrapper
void wrapper()
Definition
gradientcreationsnippet.cpp:8
qtbase
src
gui
doc
snippets
brush
gradientcreationsnippet.cpp
Generated by
1.9.7