summaryrefslogtreecommitdiffstats
path: root/examples/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webengine')
-rw-r--r--examples/webengine/quicknanobrowser/BrowserDialog.qml12
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml33
2 files changed, 42 insertions, 3 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml
index d060e2828..770cfee6a 100644
--- a/examples/webengine/quicknanobrowser/BrowserDialog.qml
+++ b/examples/webengine/quicknanobrowser/BrowserDialog.qml
@@ -50,11 +50,12 @@
import QtQuick 2.1
import QtQuick.Window 2.2
-import QtWebEngine 1.2
+import QtWebEngine 1.7
Window {
+ id: window
property alias currentWebView: webView
- flags: Qt.Dialog
+ flags: Qt.Dialog | Qt.WindowStaysOnTopHint
width: 800
height: 600
visible: true
@@ -62,5 +63,12 @@ Window {
WebEngineView {
id: webView
anchors.fill: parent
+
+ onGeometryChangeRequested: {
+ window.x = geometry.x
+ window.y = geometry.y
+ window.width = geometry.width
+ window.height = geometry.height
+ }
}
}
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index 16efc9e37..f3bd8e457 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -57,7 +57,7 @@ import QtQuick.Controls.Styles 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.0
import QtQuick.Window 2.1
-import QtWebEngine 1.3
+import QtWebEngine 1.7
ApplicationWindow {
id: browserWindow
@@ -87,6 +87,8 @@ ApplicationWindow {
property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked
property alias autoLoadIconsForPage: autoLoadIconsForPage.checked
property alias touchIconsEnabled: touchIconsEnabled.checked
+ property alias webRTCPublicInterfacesOnly : webRTCPublicInterfacesOnly.checked
+ property alias devToolsEnabled: devToolsEnabled.checked
}
Action {
@@ -311,6 +313,18 @@ ApplicationWindow {
checked: WebEngine.settings.touchIconsEnabled
enabled: autoLoadIconsForPage.checked
}
+ MenuItem {
+ id: webRTCPublicInterfacesOnly
+ text: "WebRTC Public Interfaces Only"
+ checkable: true
+ checked: WebEngine.settings.webRTCPublicInterfacesOnly
+ }
+ MenuItem {
+ id: devToolsEnabled
+ text: "Open DevTools"
+ checkable: true
+ checked: false
+ }
}
}
}
@@ -384,6 +398,7 @@ ApplicationWindow {
settings.fullScreenSupportEnabled: appSettings.fullScreenSupportEnabled
settings.autoLoadIconsForPage: appSettings.autoLoadIconsForPage
settings.touchIconsEnabled: appSettings.touchIconsEnabled
+ settings.webRTCPublicInterfacesOnly: appSettings.webRTCPublicInterfacesOnly
onCertificateError: {
error.defer();
@@ -423,6 +438,13 @@ ApplicationWindow {
request.accept();
}
+ onQuotaPermissionRequested: {
+ if (request.requestedSize <= 5 * 1024 * 1024)
+ request.accept();
+ else
+ request.reject();
+ }
+
onRenderProcessTerminated: {
var status = "";
switch (terminationStatus) {
@@ -461,6 +483,15 @@ ApplicationWindow {
}
}
}
+ WebEngineView {
+ id: devToolsView
+ visible: devToolsEnabled.checked
+ height: 400
+ inspectedView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : null
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ }
MessageDialog {
id: sslDialog