Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_corelib_animation_qvariantanimation.cpp
Go to the documentation of this file.
1// Copyright (C) 2018 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QVariantAnimation>
5#include <QColor>
6
7//! [0]
8QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)
9{
10 // ...
11 return QColor(/*...*/);
12}
13// ...
15{
16 // ...
17 qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
18 // ...
19}
20//! [0]
21
22//! [1]
23 QVariant myInterpolator(const QVariant &from, const QVariant &to, qreal progress);
24//! [1]
QVariant myInterpolator(const QVariant &from, const QVariant &to, qreal progress)
[0]
QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)
[0]