diff options
Diffstat (limited to 'examples/multimedia/video/qmlvideo/main.cpp')
-rw-r--r-- | examples/multimedia/video/qmlvideo/main.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/multimedia/video/qmlvideo/main.cpp b/examples/multimedia/video/qmlvideo/main.cpp index 81c38d240..a14684ff7 100644 --- a/examples/multimedia/video/qmlvideo/main.cpp +++ b/examples/multimedia/video/qmlvideo/main.cpp @@ -129,13 +129,11 @@ int main(int argc, char *argv[]) rootObject, SLOT(qmlFramePainted())); #endif - QUrl videoPath; const QStringList moviesLocation = QStandardPaths::standardLocations(QStandardPaths::MoviesLocation); - if (moviesLocation.isEmpty()) { - QUrl appPath(QString("file://%1").arg(app.applicationDirPath())); - videoPath = appPath.resolved(QUrl("./")); - } else - videoPath = QString("file://%1").arg(moviesLocation.first()); + const QUrl videoPath = + QUrl::fromLocalFile(moviesLocation.isEmpty() ? + app.applicationDirPath() : + moviesLocation.front()); viewer.rootContext()->setContextProperty("videoPath", videoPath); QMetaObject::invokeMethod(rootObject, "init"); |