diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2025-09-16 09:45:25 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2025-09-17 08:52:17 +0000 |
| commit | df85d6027debb67562c1ad36147c997de6ff2bed (patch) | |
| tree | 6b4556d1da4ba0ce0a3aaab6643df23bafee03fa /examples/webenginequick/nanobrowser/ApplicationRoot.qml | |
| parent | 3e19f39999de92c3791c4ff5fd27fbed511a6440 (diff) | |
Update the Quick Nano Browser, again
Adapt to recent change
qtwebengine/8857aee03670925cce927a33e66466769a32054e.
Pick-to: 6.10
Task-number: QTBUG-138589
Task-number: PYSIDE-2206
Change-Id: I2af3d14f10f1f54b3522ba3181632fb91d21fd9b
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/webenginequick/nanobrowser/ApplicationRoot.qml')
| -rw-r--r-- | examples/webenginequick/nanobrowser/ApplicationRoot.qml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/webenginequick/nanobrowser/ApplicationRoot.qml b/examples/webenginequick/nanobrowser/ApplicationRoot.qml index f36249802..ec5716207 100644 --- a/examples/webenginequick/nanobrowser/ApplicationRoot.qml +++ b/examples/webenginequick/nanobrowser/ApplicationRoot.qml @@ -1,22 +1,24 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +pragma ComponentBehavior: Bound + import QtQuick import QtWebEngine QtObject { id: root - property QtObject defaultProfilePrototype : WebEngineProfilePrototype { + property WebEngineProfilePrototype defaultProfilePrototype : WebEngineProfilePrototype { storageName: "Profile" Component.onCompleted: { - let fullVersionList = defaultProfilePrototype.instance().clientHints.fullVersionList; + let fullVersionList = root.defaultProfilePrototype.instance().clientHints.fullVersionList; fullVersionList["QuickNanoBrowser"] = "1.0"; - defaultProfilePrototype.instance().clientHints.fullVersionList = fullVersionList; + root.defaultProfilePrototype.instance().clientHints.fullVersionList = fullVersionList; } } - property QtObject otrPrototype : WebEngineProfilePrototype { + property WebEngineProfilePrototype otrPrototype : WebEngineProfilePrototype { } property Component browserWindowComponent: BrowserWindow { @@ -26,18 +28,18 @@ QtObject { onClosing: destroy() } function createWindow(profile) { - var newWindow = browserWindowComponent.createObject(root); + var newWindow = browserWindowComponent.createObject(root) as BrowserWindow; newWindow.currentWebView.profile = profile; profile.downloadRequested.connect(newWindow.onDownloadRequested); return newWindow; } function createDialog(profile) { - var newDialog = browserDialogComponent.createObject(root); + var newDialog = browserDialogComponent.createObject(root) as BrowserDialog; newDialog.currentWebView.profile = profile; return newDialog; } function load(url) { - var browserWindow = createWindow(defaultProfilePrototype.instance()); + var browserWindow = createWindow(root.defaultProfilePrototype.instance()); browserWindow.currentWebView.url = url; } } |
