summaryrefslogtreecommitdiffstats
path: root/tests/manual/animation-keyframe-programmatic/main.cpp
blob: 0d82b8e738f7ef80457347cdc021b6df86601a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include <QGuiApplication>
#include <Qt3DAnimation/QAnimationAspect>
#include <Qt3DQuickExtras/Qt3DQuickWindow>
#include <Qt3DQuick/QQmlAspectEngine>
#include <QQmlEngine>
#include <QQmlContext>

#include "animationfactory.h"

int main(int argc, char **argv)
{
    QGuiApplication app(argc, argv);

    AnimationFactory animationFactory;

    Qt3DExtras::Quick::Qt3DQuickWindow view;
    view.registerAspect(new Qt3DAnimation::QAnimationAspect());
    view.engine()->qmlEngine()->rootContext()->setContextProperty("_animationFactory", &animationFactory);
    view.setSource(QUrl("qrc:/main.qml"));
    view.show();
    return app.exec();
}