summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideo')
-rw-r--r--examples/multimedia/video/qmlvideo/main.cpp10
-rw-r--r--examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp129
-rw-r--r--examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h70
-rw-r--r--examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri5
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo.pro4
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo.qrc47
6 files changed, 54 insertions, 211 deletions
diff --git a/examples/multimedia/video/qmlvideo/main.cpp b/examples/multimedia/video/qmlvideo/main.cpp
index 86b91482b..8230e9441 100644
--- a/examples/multimedia/video/qmlvideo/main.cpp
+++ b/examples/multimedia/video/qmlvideo/main.cpp
@@ -43,9 +43,10 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtQml/QQmlContext>
+#include <QtQml/QQmlEngine>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickItem>
-#include "qmlapplicationviewer.h"
+#include <QtQuick/QQuickView>
#include "trace.h"
#ifdef PERFORMANCEMONITOR_SUPPORT
@@ -108,9 +109,10 @@ int main(int argc, char *argv[])
url2 = QUrl::fromLocalFile(source2);
}
- QmlApplicationViewer viewer;
+ QQuickView viewer;
+ viewer.setSource(QUrl("qrc:///qml/qmlvideo/main.qml"));
+ QObject::connect(viewer.engine(), SIGNAL(quit()), &viewer, SLOT(close()));
- viewer.setMainQmlFile(QLatin1String("qml/qmlvideo/main.qml"));
QQuickItem *rootObject = viewer.rootObject();
rootObject->setProperty("source1", url1);
rootObject->setProperty("source2", url2);
@@ -133,7 +135,7 @@ int main(int argc, char *argv[])
QMetaObject::invokeMethod(rootObject, "init");
- viewer.showExpanded();
+ viewer.show();
return app.exec();
}
diff --git a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp b/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp
deleted file mode 100644
index 2ffc0b219..000000000
--- a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 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 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmlapplicationviewer.h"
-
-#include <QtCore/QDir>
-#include <QtCore/QFileInfo>
-#include <QtQml/QQmlComponent>
-#include <QtQml/QQmlEngine>
-#include <QtQml/QQmlContext>
-#include <QtGui/QGuiApplication>
-
-class QmlApplicationViewerPrivate
-{
- QmlApplicationViewerPrivate(QQuickView *view_) : view(view_) {}
-
- QString mainQmlFile;
- QQuickView *view;
- friend class QmlApplicationViewer;
- QString adjustPath(const QString &path);
-};
-
-QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
-{
-#ifdef Q_OS_UNIX
-#ifdef Q_OS_MAC
- if (!QDir::isAbsolutePath(path))
- return QCoreApplication::applicationDirPath()
- + QLatin1String("/../Resources/") + path;
-#else
- QString pathInInstallDir;
- const QString applicationDirPath = QCoreApplication::applicationDirPath();
- pathInInstallDir = QString::fromLatin1("%1/../%2").arg(applicationDirPath, path);
-
- if (QFileInfo(pathInInstallDir).exists())
- return pathInInstallDir;
-#endif
-#endif
- return path;
-}
-
-QmlApplicationViewer::QmlApplicationViewer(QWindow *parent)
- : QQuickView(parent)
- , d(new QmlApplicationViewerPrivate(this))
-{
- connect(engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
- setResizeMode(QQuickView::SizeRootObjectToView);
-}
-
-QmlApplicationViewer::QmlApplicationViewer(QQuickView *view, QWindow *parent)
- : QQuickView(parent)
- , d(new QmlApplicationViewerPrivate(view))
-{
- connect(view->engine(), SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
- view->setResizeMode(QQuickView::SizeRootObjectToView);
-}
-
-QmlApplicationViewer::~QmlApplicationViewer()
-{
- delete d;
-}
-
-QmlApplicationViewer *QmlApplicationViewer::create()
-{
- return new QmlApplicationViewer();
-}
-
-void QmlApplicationViewer::setMainQmlFile(const QString &file)
-{
- d->mainQmlFile = d->adjustPath(file);
- d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
-}
-
-void QmlApplicationViewer::addImportPath(const QString &path)
-{
- d->view->engine()->addImportPath(d->adjustPath(path));
-}
-
-void QmlApplicationViewer::showExpanded()
-{
-#if defined(Q_WS_SIMULATOR)
- d->view->showFullScreen();
-#else
- d->view->show();
-#endif
-}
-
-QGuiApplication *createApplication(int &argc, char **argv)
-{
- return new QGuiApplication(argc, argv);
-}
diff --git a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h b/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h
deleted file mode 100644
index a4eabdba8..000000000
--- a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** 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
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 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 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMLAPPLICATIONVIEWER_H
-#define QMLAPPLICATIONVIEWER_H
-
-#include <QtQuick/QQuickView>
-#include <QtGui/QGuiApplication>
-
-class QmlApplicationViewer : public QQuickView
-{
- Q_OBJECT
-
-public:
- explicit QmlApplicationViewer(QWindow *parent = 0);
- virtual ~QmlApplicationViewer();
-
- static QmlApplicationViewer *create();
-
- void setMainQmlFile(const QString &file);
- void addImportPath(const QString &path);
-
- void showExpanded();
-
-private:
- explicit QmlApplicationViewer(QQuickView *view, QWindow *parent);
- class QmlApplicationViewerPrivate *d;
-};
-
-QGuiApplication *createApplication(int &argc, char **argv);
-
-#endif // QMLAPPLICATIONVIEWER_H
diff --git a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri b/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri
deleted file mode 100644
index 75d66c36b..000000000
--- a/examples/multimedia/video/qmlvideo/qmlapplicationviewer/qmlapplicationviewer.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-QT += qml quick
-
-SOURCES += $$PWD/qmlapplicationviewer.cpp
-HEADERS += $$PWD/qmlapplicationviewer.h
-INCLUDEPATH += $$PWD
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo.pro b/examples/multimedia/video/qmlvideo/qmlvideo.pro
index 78c6f0540..3ea513d3a 100644
--- a/examples/multimedia/video/qmlvideo/qmlvideo.pro
+++ b/examples/multimedia/video/qmlvideo/qmlvideo.pro
@@ -1,6 +1,8 @@
TEMPLATE = app
TARGET = qmlvideo
+QT += quick
+
LOCAL_SOURCES = main.cpp
LOCAL_HEADERS = trace.h
@@ -11,8 +13,6 @@ RESOURCES += qmlvideo.qrc
SNIPPETS_PATH = ../snippets
include($$SNIPPETS_PATH/performancemonitor/performancemonitordeclarative.pri)
-include(qmlapplicationviewer/qmlapplicationviewer.pri)
-
target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/video/qmlvideo
INSTALLS += target
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo.qrc b/examples/multimedia/video/qmlvideo/qmlvideo.qrc
index 4896b336f..5bf2df8af 100644
--- a/examples/multimedia/video/qmlvideo/qmlvideo.qrc
+++ b/examples/multimedia/video/qmlvideo/qmlvideo.qrc
@@ -1,5 +1,5 @@
<RCC>
- <qresource prefix="/images">
+ <qresource prefix="/">
<file alias="leaves.jpg">images/leaves.jpg</file>
<file alias="close.png">images/close.png</file>
<file alias="folder.png">images/folder.png</file>
@@ -8,5 +8,50 @@
<file alias="up.png">images/up.png</file>
<file alias="progress_handle.svg">images/progress_handle.svg</file>
<file alias="progress_handle_pressed.svg">images/progress_handle_pressed.svg</file>
+ <file>qml/qmlvideo/Button.qml</file>
+ <file>qml/qmlvideo/CameraBasic.qml</file>
+ <file>qml/qmlvideo/CameraDrag.qml</file>
+ <file>qml/qmlvideo/CameraDummy.qml</file>
+ <file>qml/qmlvideo/CameraFullScreen.qml</file>
+ <file>qml/qmlvideo/CameraFullScreenInverted.qml</file>
+ <file>qml/qmlvideo/CameraItem.qml</file>
+ <file>qml/qmlvideo/CameraMove.qml</file>
+ <file>qml/qmlvideo/CameraOverlay.qml</file>
+ <file>qml/qmlvideo/CameraResize.qml</file>
+ <file>qml/qmlvideo/CameraRotate.qml</file>
+ <file>qml/qmlvideo/CameraSpin.qml</file>
+ <file>qml/qmlvideo/Content.qml</file>
+ <file>qml/qmlvideo/DisableScreenSaver.qml</file>
+ <file>qml/qmlvideo/ErrorDialog.qml</file>
+ <file>qml/qmlvideo/FileBrowser.qml</file>
+ <file>qml/qmlvideo/main.qml</file>
+ <file>qml/qmlvideo/Scene.qml</file>
+ <file>qml/qmlvideo/SceneBasic.qml</file>
+ <file>qml/qmlvideo/SceneDrag.qml</file>
+ <file>qml/qmlvideo/SceneFullScreen.qml</file>
+ <file>qml/qmlvideo/SceneFullScreenInverted.qml</file>
+ <file>qml/qmlvideo/SceneMove.qml</file>
+ <file>qml/qmlvideo/SceneMulti.qml</file>
+ <file>qml/qmlvideo/SceneOverlay.qml</file>
+ <file>qml/qmlvideo/SceneResize.qml</file>
+ <file>qml/qmlvideo/SceneRotate.qml</file>
+ <file>qml/qmlvideo/SceneSelectionPanel.qml</file>
+ <file>qml/qmlvideo/SceneSpin.qml</file>
+ <file>qml/qmlvideo/SeekControl.qml</file>
+ <file>qml/qmlvideo/VideoBasic.qml</file>
+ <file>qml/qmlvideo/VideoDrag.qml</file>
+ <file>qml/qmlvideo/VideoDummy.qml</file>
+ <file>qml/qmlvideo/VideoFillMode.qml</file>
+ <file>qml/qmlvideo/VideoFullScreen.qml</file>
+ <file>qml/qmlvideo/VideoFullScreenInverted.qml</file>
+ <file>qml/qmlvideo/VideoItem.qml</file>
+ <file>qml/qmlvideo/VideoMetadata.qml</file>
+ <file>qml/qmlvideo/VideoMove.qml</file>
+ <file>qml/qmlvideo/VideoOverlay.qml</file>
+ <file>qml/qmlvideo/VideoPlaybackRate.qml</file>
+ <file>qml/qmlvideo/VideoResize.qml</file>
+ <file>qml/qmlvideo/VideoRotate.qml</file>
+ <file>qml/qmlvideo/VideoSeek.qml</file>
+ <file>qml/qmlvideo/VideoSpin.qml</file>
</qresource>
</RCC>