2014-06-04 14:36:43 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
|
|
|
|
** Contact: http://www.qt-project.org/legal
|
|
|
|
**
|
|
|
|
** This file is part of the Qt3D module of the Qt Toolkit.
|
|
|
|
**
|
2015-02-09 13:58:07 +00:00
|
|
|
** $QT_BEGIN_LICENSE:LGPL3$
|
2014-06-04 14:36:43 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-02-09 13:58:07 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see http://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at http://www.qt.io/contact-us.
|
2014-06-04 14:36:43 +00:00
|
|
|
**
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2015-02-09 13:58:07 +00:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 3 requirements
|
|
|
|
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
2014-06-04 14:36:43 +00:00
|
|
|
**
|
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
2015-02-09 13:58:07 +00:00
|
|
|
** General Public License version 2.0 or later as published by the Free
|
|
|
|
** Software Foundation and appearing in the file LICENSE.GPL included in
|
|
|
|
** the packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU General Public License version 2.0 requirements will be
|
|
|
|
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
2014-06-04 14:36:43 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-06-11 12:23:22 +00:00
|
|
|
#include <window.h>
|
2015-10-18 08:58:19 +00:00
|
|
|
#include <Qt3DRender/QRenderAspect>
|
2015-01-20 14:16:21 +00:00
|
|
|
#include <Qt3DInput/QInputAspect>
|
2015-01-20 14:37:54 +00:00
|
|
|
#include <Qt3DQuick/QQmlAspectEngine>
|
2014-06-04 14:36:43 +00:00
|
|
|
|
|
|
|
#include <QGuiApplication>
|
|
|
|
#include <QtQml>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
QGuiApplication app(argc, argv);
|
2015-06-11 12:23:22 +00:00
|
|
|
Window view;
|
2015-10-12 19:45:19 +00:00
|
|
|
Qt3DCore::Quick::QQmlAspectEngine engine;
|
2014-10-31 10:35:45 +00:00
|
|
|
|
2015-08-31 14:14:17 +00:00
|
|
|
engine.aspectEngine()->registerAspect(new Qt3DRender::QRenderAspect());
|
2015-08-30 15:39:18 +00:00
|
|
|
engine.aspectEngine()->registerAspect(new Qt3DInput::QInputAspect());
|
2014-10-31 10:35:45 +00:00
|
|
|
QVariantMap data;
|
|
|
|
data.insert(QStringLiteral("surface"), QVariant::fromValue(static_cast<QSurface *>(&view)));
|
2015-01-20 14:53:29 +00:00
|
|
|
data.insert(QStringLiteral("eventSource"), QVariant::fromValue(&view));
|
2014-10-31 10:35:45 +00:00
|
|
|
engine.aspectEngine()->setData(data);
|
|
|
|
engine.setSource(QUrl("qrc:/main.qml"));
|
2014-06-04 14:36:43 +00:00
|
|
|
view.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|