| 1 | // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include <QGuiApplication> |
| 5 | #include <Qt3DAnimation/QAnimationAspect> |
| 6 | #include <Qt3DQuickExtras/Qt3DQuickWindow> |
| 7 | #include <Qt3DQuick/QQmlAspectEngine> |
| 8 | #include <QQmlEngine> |
| 9 | #include <QQmlContext> |
| 10 | |
| 11 | #include "animationfactory.h" |
| 12 | |
| 13 | int main(int argc, char **argv) |
| 14 | { |
| 15 | QGuiApplication app(argc, argv); |
| 16 | |
| 17 | AnimationFactory animationFactory; |
| 18 | |
| 19 | Qt3DExtras::Quick::Qt3DQuickWindow view; |
| 20 | view.registerAspect(new Qt3DAnimation::QAnimationAspect()); |
| 21 | view.engine()->qmlEngine()->rootContext()->setContextProperty("_animationFactory", &animationFactory); |
| 22 | view.setSource(QUrl("qrc:/main.qml")); |
| 23 | view.show(); |
| 24 | return app.exec(); |
| 25 | } |