跳转至

ui/base/easing.h

Easing curves and spring animation presets. More...

Namespaces

Name
cf
cf::ui
cf::ui::base
cf::ui::base::Easing
Easing curves and spring presets for animations.

Classes

Name
struct cf::ui::base::Easing::SpringPreset
Spring physics preset for animations.

Detailed Description

Easing curves and spring animation presets.

Author: Charliechen114514

Version: 0.1

Since: 0.1

Date: 2026-02-23

Provides convenient access to predefined easing curves and spring physics presets for smooth animations following Material Design motion principles.

Source code

#pragma once
#include <QEasingCurve>

namespace cf::ui::base {
namespace Easing {

enum class Type {
    Emphasized,           
    EmphasizedDecelerate, 
    EmphasizedAccelerate, 
    Standard,             
    StandardDecelerate,   
    StandardAccelerate,   
    Linear                
};

QEasingCurve fromEasingType(const Type t);

QEasingCurve custom(float x1, float y1, float x2, float y2);

struct SpringPreset {
    float stiffness; 
    float damping;   
};

SpringPreset springGentle();

SpringPreset springBouncy();

SpringPreset springStiff();

} // namespace Easing

} // namespace cf::ui::base

Updated on 2026-03-09 at 10:14:01 +0000