Fix file browser in qmlvideo example.
Use QUrl::fromLocalFile() to get Windows drive handling right. Emulate its behavior in QML code. Fix up() to terminate correctly. Task-number: QTBUG-32139 Change-Id: Iec6d9f96fbe2181c939e9dbbe6aa042eac630918 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
9f26d9e242
commit
de9092389f
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user