diff options
author | Anu Aliyas <anu.aliyas@qt.io> | 2023-07-24 12:15:37 +0200 |
---|---|---|
committer | Anu Aliyas <anu.aliyas@qt.io> | 2024-03-07 17:22:31 +0100 |
commit | f351131e7549452247bbe2b71e51539a2824812c (patch) | |
tree | 3176d6fff26b84fb5fcff2e3d6ff1cf767620765 /examples/webenginequick | |
parent | 290d7462696664a1e035082793907d3c698bc987 (diff) |
Add setting method to set image animation policy
- added a method to set image animation policy in QWebEngineSettings
Fixes: QTBUG-86154
Change-Id: I8b3ab6067f9cff4219b0da90bb8601406cb98e24
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'examples/webenginequick')
-rw-r--r-- | examples/webenginequick/quicknanobrowser/BrowserWindow.qml | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml index 266763bd2..cf69fde3b 100644 --- a/examples/webenginequick/quicknanobrowser/BrowserWindow.qml +++ b/examples/webenginequick/quicknanobrowser/BrowserWindow.qml @@ -44,6 +44,7 @@ ApplicationWindow { property alias webRTCPublicInterfacesOnly : webRTCPublicInterfacesOnly.checked property alias devToolsEnabled: devToolsEnabled.checked property alias pdfViewerEnabled: pdfViewerEnabled.checked + property int imageAnimationPolicy: WebEngineSettings.AllowImageAnimation } Action { @@ -362,10 +363,49 @@ ApplicationWindow { } MenuItem { id: pdfViewerEnabled - text: "PDF viewer enabled" + text: "PDF Viewer Enabled" checkable: true checked: WebEngine.settings.pdfViewerEnabled } + + Menu { + id: imageAnimationPolicy + title: "Image Animation Policy" + + MenuItem { + id: disableImageAnimation + text: "Disable All Image Animation" + checkable: true + autoExclusive: true + checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.DisallowImageAnimation + onTriggered: { + appSettings.imageAnimationPolicy = WebEngineSettings.DisallowImageAnimation + } + } + + MenuItem { + id: allowImageAnimation + text: "Allow All Animated Images" + checkable: true + autoExclusive: true + checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.AllowImageAnimation + onTriggered : { + appSettings.imageAnimationPolicy = WebEngineSettings.AllowImageAnimation + } + } + + MenuItem { + id: animateImageOnce + text: "Animate Image Once" + checkable: true + autoExclusive: true + checked: WebEngine.settings.imageAnimationPolicy === WebEngineSettings.AnimateImageOnce + onTriggered : { + appSettings.imageAnimationPolicy = WebEngineSettings.AnimateImageOnce + } + } + } + } } } @@ -520,6 +560,7 @@ ApplicationWindow { settings.touchIconsEnabled: appSettings.touchIconsEnabled settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly settings.pdfViewerEnabled: appSettings.pdfViewerEnabled + settings.imageAnimationPolicy: appSettings.imageAnimationPolicy onCertificateError: function(error) { error.defer(); |