diff options
author | Keränen Pasi <pasi.keranen@digia.com> | 2013-09-27 09:05:53 +0300 |
---|---|---|
committer | Pasi Keränen <pasi.keranen@digia.com> | 2013-10-08 10:50:41 +0300 |
commit | 66e1b09592efe77f839a0878ec6165a02408ca6f (patch) | |
tree | 709736fc6693c014abc0467a7c1ac766c1c62c4f /tests/qmlcamera/main.cpp | |
parent | 0daa4359bdaba6372bc8235550892afdef003120 (diff) |
Added Camera QML API and Example
Change-Id: Ibc790ac6c720b6d22d68f662ff2f50e74a9abaae
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'tests/qmlcamera/main.cpp')
-rw-r--r-- | tests/qmlcamera/main.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/qmlcamera/main.cpp b/tests/qmlcamera/main.cpp new file mode 100644 index 00000000..90d81eab --- /dev/null +++ b/tests/qmlcamera/main.cpp @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +#include <QtGui/QGuiApplication> +#include "qtquick2applicationviewer.h" + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QtQuick2ApplicationViewer viewer; +#ifdef Q_OS_ANDROID + viewer.addImportPath(QString::fromLatin1("assets:/qml")); + viewer.engine()->addPluginPath(QString::fromLatin1("%1/../%2").arg(QDir::homePath(), + QString::fromLatin1("lib"))); +#else + viewer.addImportPath(QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), + QString::fromLatin1("qml"))); +#endif + viewer.setMainQmlFile(QStringLiteral("qml/qmlcamera/main.qml")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.showExpanded(); + + return app.exec(); +} |