summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp
blob: be7f549f655315866c2f38c02ed15600cd32488c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
    QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress)
    {
        ...
        return QColor(...);
    }
    ...
    qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
//! [0]

//! [1]
    QVariant myInterpolator(const QVariant &from, const QVariant &to, qreal progress);
//! [1]