diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2014-12-11 19:57:58 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-01-12 16:34:58 +0100 |
commit | e6a74159cebdbfec575f40469c216c90ee8651c1 (patch) | |
tree | 331f7a51b9d0c77568bb2744fbd8155733424374 /src/webengine/plugin/experimental | |
parent | 4557ccd9785f53abc11460211c84db3e564b364f (diff) |
Add QML download API
This patch exposes downloadStarted and downloadFinished
signals on the WebEngineProfile to notify about downloads.
The WebEngineDownloadItem exposes a subset of Chromium's
content::DownloadItem functionality.
For now we expose minimal requirements to be able to control
downloads in QML but this can be extended in the future.
This patch also adds a DownloadView to quicktestbrowser
to demonstrate the usage of the new API.
[ChangeLog][QtWebEngineQML] Add QtQuick download API
Change-Id: I8d8f0daf02c4e0151000427fc2a4b37d28b9db52
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/webengine/plugin/experimental')
-rw-r--r-- | src/webengine/plugin/experimental/plugin.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp index 883ebc598..f522478ab 100644 --- a/src/webengine/plugin/experimental/plugin.cpp +++ b/src/webengine/plugin/experimental/plugin.cpp @@ -36,6 +36,7 @@ #include <QtQml/qqmlextensionplugin.h> +#include "qquickwebenginedownloaditem_p.h" #include "qquickwebenginehistory_p.h" #include "qquickwebenginesettings_p.h" #include "qquickwebenginesingleton_p.h" @@ -80,7 +81,9 @@ public: QObject::tr("Cannot create a separate instance of NavigationHistory")); qmlRegisterUncreatableType<QQuickWebEngineSettings>(uri, 1, 0, "WebEngineSettings", QObject::tr("Cannot create a separate instance of WebEngineSettings")); - qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 0, "WebEngine", webEngineSingletonProvider); + qmlRegisterUncreatableType<QQuickWebEngineDownloadItem>(uri, 1, 1, "WebEngineDownloadItem", + QObject::tr("Cannot create a separate instance of WebEngineDownloadItem")); + qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 1, "WebEngine", webEngineSingletonProvider); } }; |