summaryrefslogtreecommitdiffstats
path: root/examples/video/qmlvideo/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/video/qmlvideo/main.cpp')
-rw-r--r--examples/video/qmlvideo/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/video/qmlvideo/main.cpp b/examples/video/qmlvideo/main.cpp
index 85a7af045..495dc0299 100644
--- a/examples/video/qmlvideo/main.cpp
+++ b/examples/video/qmlvideo/main.cpp
@@ -39,8 +39,10 @@
**
****************************************************************************/
+#include <QtCore/QStandardPaths>
#include <QtCore/QString>
#include <QtCore/QStringList>
+#include <QtDeclarative/QDeclarativeContext>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickItem>
#include "qmlapplicationviewer.h"
@@ -124,6 +126,12 @@ int main(int argc, char *argv[])
rootObject, SLOT(qmlFramePainted()));
#endif
+ QString videoPath;
+ const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation);
+ if (!moviesLocation.isEmpty())
+ videoPath = moviesLocation.first();
+ viewer.rootContext()->setContextProperty("videoPath", videoPath);
+
QMetaObject::invokeMethod(rootObject, "init");
viewer.showExpanded();