WebEngineView 渲染 QML 應用程序中的 Web 內容。 更多...
| import 語句: |
import QtWebEngine
|
| Since: | QtWebEngine 1.0 |
| 繼承: |
(since QtWebEngine 1.10)
(since QtWebEngine 1.3)
(since QtWebEngine 1.3)
(since QtWebEngine 1.2)
(since QtWebEngine 1.2)
(since QtWebEngine 1.2)
(since QtWebEngine 1.3)
(since QtWebEngine 1.2)
(since QtWebEngine 1.3)
(since QtWebEngine 6.6)
(since QtWebEngine 1.7)
(since QtWebEngine 1.1)
(since QtWebEngine 1.7)
(since QtWebEngine 1.1)
(since QtWebEngine 1.10)
(since QtWebEngine 6.8)
(since QtWebEngine 1.1)
(since QtWebEngine 1.3)
(since QtWebEngine 1.10)
(since QtWebEngine 1.11)
(since QtWebEngine 1.3)
(since QtWebEngine 1.1)
(since QtWebEngine 6.4)
(since QtWebEngine 1.1)
(since QtWebEngine 1.1)
(since QtWebEngine 1.3)
(since QtWebEngine 1.1)
(since QtWebEngine 1.2)
(since QtWebEngine 1.3)
(since QtWebEngine 1.4)
(since QtWebEngine 1.2)
(since QtWebEngine 1.1)
(since QtWebEngine 1.4)
(since QtWebEngine 1.4)
(since QtWebEngine 6.7)
(since QtWebEngine 1.4)
(since QtWebEngine 1.10)
(since QtWebEngine 1.1)
(since QtWebEngine 1.7)
(since QtWebEngine 1.4)
(since QtWebEngine 2.0)
(since QtWebEngine 1.5)
(since QtWebEngine 6.8)
(since QtWebEngine 1.8)
(since QtWebEngine 6.8)
(since QtWebEngine 1.3)
(since QtWebEngine 1.7)
(since QtWebEngine 1.11)
(since QtWebEngine 1.2)
(since QtWebEngine 1.9)
(since QtWebEngine 1.10)
(since QtWebEngine 6.3)
(since QtWebEngine 1.3)
(since QtWebEngine 6.7)
(since QtWebEngine 1.2)
(since QtWebEngine 6.8)
(since QtWebEngine 2.0)
(since QtWebEngine 6.8)
(since QtWebEngine 1.1)
(since QtWebEngine 1.1)
(since QtWebEngine 1.1)
(since QtWebEngine 1.1)
(since QtWebEngine 1.1)
(since QtWebEngine 1.3)
(since QtWebEngine 1.3)
(since QtWebEngine 1.1)
(since QtWebEngine 1.3)
(since QtWebEngine 6.6)
(since QtWebEngine 1.2)
(since QtWebEngine 1.2)
The WebEngineView type enables QML applications to render regions of dynamic web content. It may share the screen with other QML types, such as a TabView, or fill the screen, as specified within the QML application.
For the web engine view to be rendered, the web engine must be initialized by using QtWebEngineQuick::initialize 在應用程序主源文件中,如以下代碼段所示:
int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QtWebEngineQuick::initialize(); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
An application can load pages into the WebEngineView, using either the url property or the loadHtml method and navigate within the view's session history. The GET method is always used to load URLs.
The history is represented by a WebEngineHistory data model that is held by the history 特性。
以下樣本 QML 應用程序加載網頁使用
url
特性:
import QtQuick import QtQuick.Window import QtWebEngine Window { width: 1024 height: 750 visible: true WebEngineView { anchors.fill: parent url: "https://www.qt.io" } }
The loading 特性保持目前是否加載 HTML 頁麵。 loadingChanged () signal is emitted when loading the page begins, ends, or fails.
HTML 頁麵標題可以被訪問采用 title property. Additionally, a web page may specify an icon, which can be accessed using the icon property. The zoomFactor property enables zooming the contents of the web page by a scale factor.
If a certificate error is raised while loading a web page, the certificateError () signal is emitted. Certificate errors are handled by using the methods of the WebEngineCertificateError 類型。
By default, links to different pages load within the same WebEngineView object, but web sites may request them to be opened as a new tab, window, or dialog. The newWindowRequested () signal is emitted when a request to load the page in a separate web engine view is issued. The NewViewDestination property describes how the new view should be opened. In addition, the WebEngineNewWindowRequest utility type can be used to load web pages in separate web engine views.
The findText () method can be used to search for a string on a web page, using the options described by FindFlags .
The setActiveFocusOnPress () method can be used to create a UI element that should not get focus on press. This can be useful in a hybrid UI.
The focusOnNavigationEnabled setting can be used to make the view automatically receive focus when a navigation operation occurs (like loading or reloading a page or navigating through history).
The
linkHovered
() signal is emitted when a mouse pointer passes over a link and thus corresponds to the
mouseover
DOM event.
Actions, such as selecting and editing content, can be performed on a web page by using the triggerWebAction () method. The available actions are described by the WebAction 特性。
The backgroundColorChanged () signal is emitted when the web page background color changes.
During the loading of a page, so called 用戶腳本 can be injected in the JavaScript engine at different points. The script objects attached to the web engine view are held by the userScripts property and injected by using the WebEngineScript type. Scripts can also be run by using the runJavaScript () method in the same world as other scripts that are part of the loaded site.
The
webChannel
property can be used to expose a WebChannel instance in the JavaScript context of the page it is rendering as
qt.webChannelTransport
.
A web page can request through the JavaScript API to be loaded in fullscreen mode. The fullScreenRequested () signal is emitted when the web page issues the request. The FullScreenRequest utility type can be used to toggle fullscreen requests. The fullScreenCancelled method can be used to notify the browser engine when the windowing system forces the application to leave fullscreen mode.
Web engine views can be isolated from each other by using the WebEngineProfile type. A profile contains settings, scripts, and the list of visited links shared by all views that belong to the profile. For example, a dedicated profile could be created for a 隱私瀏覽 mode. The current profile for the view is held by the profile property and the current settings are held by the settings property. The settings are specified by using the WebEngineSettings 類型。
Web pages can request access to platform features, such as geolocation or audio and video capture devices. The permissionRequested () signal is emitted when a web page requests to make use of a resource. The supported platform features are described by the QWebEnginePermission::Feature property.
當使用
QQuickRenderControl
to render a Qt Quick user interface to an OpenGL surface, the WebEngineView type is not rendered correctly. The web engine view attempts to use a global OpenGL context created by
QtWebEngineQuick::initialize
, but there is no public API for accessing that context in order to share it with the
QQuickRenderControl
上下文。
To have the web engine view rendered correctly, it is possible to manually create a new offscreen context that is shared with the
QQuickRenderControl
and to call the non-public function
qt_gl_set_global_share_context()
, rather than calling
initialize()
。若
initialize()
is called after setting a global context, it will do nothing.
|
ErrorDomain : enumeration |
Describes various high-level error types:
| 常量 | 描述 |
|---|---|
WebEngineView.NoErrorDomain
|
|
WebEngineView.InternalErrorDomain
|
Content fails to be interpreted by Qt WebEngine. |
WebEngineView.ConnectionErrorDomain
|
Error results from faulty network connection. |
WebEngineView.CertificateErrorDomain
|
Error related to the SSL/TLS certificate. |
WebEngineView.HttpErrorDomain
|
Error related to the HTTP connection. |
WebEngineView.FtpErrorDomain
|
Error related to the FTP connection. |
WebEngineView.DnsErrorDomain
|
Error related to the DNS connection. |
|
FindFlags : enumeration |
描述的選項可用於 findText () 函數。來自以下列錶中的選項可以 OR 在一起:
| 常量 | 描述 |
|---|---|
WebEngineView.FindBackward
|
嚮後搜索,而不是嚮前。 |
WebEngineView.FindFlags
|
FindCaseSensitively By default findText () 工作不區分大小寫。指定此選項把行為改為區分大小寫的查找操作。 |
另請參閱 findText ().
|
JavaScriptConsoleMessageLevel : enumeration |
指示 JavaScript 控製颱消息的嚴重性:
| 常量 | 描述 |
|---|---|
WebEngineView.InfoMessageLevel
|
Message is purely informative and can safely be ignored. |
WebEngineView.WarningMessageLevel
|
Message indicates there might be a problem that may need attention. |
WebEngineView.ErrorMessageLevel
|
Message indicates there has been an error. |
|
LifecycleState
:
enumeration
|
此枚舉描述頁麵生命周期狀態:
| 常量 | 描述 |
|---|---|
WebEngineView.LifecycleState.Active
|
正常狀態。 |
WebEngineView.LifecycleState.Frozen
|
低 CPU 使用率狀態,掛起大多數 HTML 任務源。 |
WebEngineView.LifecycleState.Discarded
|
很低資源使用率狀態 (整個瀏覽上下文被丟棄)。 |
該特性在 QtWebEngine 1.10 引入。
另請參閱 lifecycleState , 頁麵生命周期 API ,和 WebEngine 生命周期範例 .
|
LoadStatus : enumeration |
反射頁麵加載狀態:
| 常量 | 描述 |
|---|---|
WebEngineView.LoadStartedStatus
|
目前正在加載頁麵。 |
WebEngineView.LoadStoppedStatus
|
Loading the page was stopped by the stop () method or by the loader code or network stack in Chromium. |
WebEngineView.LoadSucceededStatus
|
Page has successfully loaded, and is not currently loading. |
WebEngineView.LoadFailedStatus
|
Page has failed to load, and is not currently loading. |
|
PrintedPageOrientation
:
enumeration
|
Describes the orientation of a PDF document that gets created from the WebEngineView 's contents. The enumeration values are mapped from and must match QPageLayout::Orientation .
| 常量 | 描述 |
|---|---|
WebEngineView.Portrait
|
The document will be created using portrait orientation. |
WebEngineView.Landscape
|
The document will be created using landscape orientation. |
該特性在 QtWebEngine 1.3 引入。
另請參閱 WebEngineView::printToPdf ().
|
PrintedPageSizeId
:
enumeration
|
This enum type lists the available page sizes as defined in the Postscript PPD standard.
The enumeration values are mapped from and must match QPageSize::PageSizeId . They are also duplicated in QPagedPaintDevice and QPrinter .
定義尺寸:
| 常量 | 描述 |
|---|---|
WebEngineView.A0
|
841 x 1189 mm |
WebEngineView.A1
|
594 x 841 mm |
WebEngineView.A2
|
420 x 594 mm |
WebEngineView.A3
|
297 x 420 mm |
WebEngineView.A4
|
210 x 297 mm, 8.26 x 11.69 inches |
WebEngineView.A5
|
148 x 210 mm |
WebEngineView.A6
|
105 x 148 mm |
WebEngineView.A7
|
74 x 105 mm |
WebEngineView.A8
|
52 x 74 mm |
WebEngineView.A9
|
37 x 52 mm |
WebEngineView.B0
|
1000 x 1414 mm |
WebEngineView.B1
|
707 x 1000 mm |
WebEngineView.B2
|
500 x 707 mm |
WebEngineView.B3
|
353 x 500 mm |
WebEngineView.B4
|
250 x 353 mm |
WebEngineView.B5
|
176 x 250 mm, 6.93 x 9.84 inches |
WebEngineView.B6
|
125 x 176 mm |
WebEngineView.B7
|
88 x 125 mm |
WebEngineView.B8
|
62 x 88 mm |
WebEngineView.B9
|
44 x 62 mm |
WebEngineView.B10
|
31 x 44 mm |
WebEngineView.C5E
|
163 x 229 mm |
WebEngineView.Comm10E
|
105 x 241 mm, U.S. Common 10 Envelope |
WebEngineView.DLE
|
110 x 220 mm |
WebEngineView.Executive
|
7.5 x 10 inches, 190.5 x 254 mm |
WebEngineView.Folio
|
210 x 330 mm |
WebEngineView.Ledger
|
431.8 x 279.4 mm |
WebEngineView.Legal
|
8.5 x 14 inches, 215.9 x 355.6 mm |
WebEngineView.Letter
|
8.5 x 11 inches, 215.9 x 279.4 mm |
WebEngineView.Tabloid
|
279.4 x 431.8 mm |
WebEngineView.Custom
|
Unknown, or a user defined size. |
WebEngineView.A10
|
|
WebEngineView.A3Extra
|
|
WebEngineView.A4Extra
|
|
WebEngineView.A4Plus
|
|
WebEngineView.A4Small
|
|
WebEngineView.A5Extra
|
|
WebEngineView.B5Extra
|
|
WebEngineView.JisB0
|
|
WebEngineView.JisB1
|
|
WebEngineView.JisB2
|
|
WebEngineView.JisB3
|
|
WebEngineView.JisB4
|
|
WebEngineView.JisB5
|
|
WebEngineView.JisB6
|
|
WebEngineView.JisB7
|
|
WebEngineView.JisB8
|
|
WebEngineView.JisB9
|
|
WebEngineView.JisB10
|
|
WebEngineView.AnsiA
|
=
Letter
|
WebEngineView.AnsiB
|
=
Ledger
|
WebEngineView.AnsiC
|
|
WebEngineView.AnsiD
|
|
WebEngineView.AnsiE
|
|
WebEngineView.LegalExtra
|
|
WebEngineView.LetterExtra
|
|
WebEngineView.LetterPlus
|
|
WebEngineView.LetterSmall
|
|
WebEngineView.TabloidExtra
|
|
WebEngineView.ArchA
|
|
WebEngineView.ArchB
|
|
WebEngineView.ArchC
|
|
WebEngineView.ArchD
|
|
WebEngineView.ArchE
|
|
WebEngineView.Imperial7x9
|
|
WebEngineView.Imperial8x10
|
|
WebEngineView.Imperial9x11
|
|
WebEngineView.Imperial9x12
|
|
WebEngineView.Imperial10x11
|
|
WebEngineView.Imperial10x13
|
|
WebEngineView.Imperial10x14
|
|
WebEngineView.Imperial12x11
|
|
WebEngineView.Imperial15x11
|
|
WebEngineView.ExecutiveStandard
|
|
WebEngineView.Note
|
|
WebEngineView.Quarto
|
|
WebEngineView.Statement
|
|
WebEngineView.SuperA
|
|
WebEngineView.SuperB
|
|
WebEngineView.Postcard
|
|
WebEngineView.DoublePostcard
|
|
WebEngineView.Prc16K
|
|
WebEngineView.Prc32K
|
|
WebEngineView.Prc32KBig
|
|
WebEngineView.FanFoldUS
|
|
WebEngineView.FanFoldGerman
|
|
WebEngineView.FanFoldGermanLegal
|
|
WebEngineView.EnvelopeB4
|
|
WebEngineView.EnvelopeB5
|
|
WebEngineView.EnvelopeB6
|
|
WebEngineView.EnvelopeC0
|
|
WebEngineView.EnvelopeC1
|
|
WebEngineView.EnvelopeC2
|
|
WebEngineView.EnvelopeC3
|
|
WebEngineView.EnvelopeC4
|
|
WebEngineView.EnvelopeC5
|
=
C5E
|
WebEngineView.EnvelopeC6
|
|
WebEngineView.EnvelopeC65
|
|
WebEngineView.EnvelopeC7
|
|
WebEngineView.EnvelopeDL
|
=
DLE
|
WebEngineView.Envelope9
|
|
WebEngineView.Envelope10
|
=
Comm10E
|
WebEngineView.Envelope11
|
|
WebEngineView.Envelope12
|
|
WebEngineView.Envelope14
|
|
WebEngineView.EnvelopeMonarch
|
|
WebEngineView.EnvelopePersonal
|
|
WebEngineView.EnvelopeChou3
|
|
WebEngineView.EnvelopeChou4
|
|
WebEngineView.EnvelopeInvite
|
|
WebEngineView.EnvelopeItalian
|
|
WebEngineView.EnvelopeKaku2
|
|
WebEngineView.EnvelopeKaku3
|
|
WebEngineView.EnvelopePrc1
|
|
WebEngineView.EnvelopePrc2
|
|
WebEngineView.EnvelopePrc3
|
|
WebEngineView.EnvelopePrc4
|
|
WebEngineView.EnvelopePrc5
|
|
WebEngineView.EnvelopePrc6
|
|
WebEngineView.EnvelopePrc7
|
|
WebEngineView.EnvelopePrc8
|
|
WebEngineView.EnvelopePrc9
|
|
WebEngineView.EnvelopePrc10
|
|
WebEngineView.EnvelopeYou4
|
|
WebEngineView.LastPageSize
|
=
EnvelopeYou4
|
該特性在 QtWebEngine 1.3 引入。
另請參閱 WebEngineView::printToPdf ().
|
RenderProcessTerminationStatus
:
enumeration
|
Describes the status with which the render process terminated:
| 常量 | 描述 |
|---|---|
WebEngineView.NormalTerminationStatus
|
渲染進程正常終止。 |
WebEngineView.AbnormalTerminationStatus
|
The render process terminated with a non-zero exit status. |
WebEngineView.CrashedTerminationStatus
|
渲染進程崩潰 (例如:由於分段故障)。 |
WebEngineView.KilledTerminationStatus
|
渲染進程被殺除,例如被
SIGKILL
或被任務管理器殺除。
|
This property was introduced in QtWebEngine 1.2.
|
WebAction
:
enumeration
|
Describes the types of action that can be performed on a web page:
| 常量 | 描述 |
|---|---|
WebEngineView.NoWebAction
|
沒有動作被觸發。 |
WebEngineView.Back
|
在導航鏈接曆史中後退導航。 |
WebEngineView.Forward
|
在導航鏈接曆史中前進導航。 |
WebEngineView.Stop
|
停止加載當前頁麵。 |
WebEngineView.Reload
|
重新加載當前頁麵。 |
WebEngineView.ReloadAndBypassCache
|
重新加載當前頁麵,但不使用任何本地緩存。 |
WebEngineView.Cut
|
把目前選中內容剪切到剪貼闆。 |
WebEngineView.Copy
|
把目前選中內容拷貝到剪貼闆。 |
WebEngineView.Paste
|
從剪貼闆粘貼內容。 |
WebEngineView.Undo
|
撤消上一編輯動作。 |
WebEngineView.Redo
|
重做上一編輯動作。 |
WebEngineView.SelectAll
|
選擇所有內容。纔啓用此動作,當聚焦頁麵內容時。可以強製聚焦通過 JavaScript
window.focus()
調用,或
focusOnNavigationEnabled
設置應啓用以獲得自動聚焦。
|
WebEngineView.PasteAndMatchStyle
|
采用當前樣式從剪貼闆粘貼內容。 |
WebEngineView.OpenLinkInThisWindow
|
在當前窗口打開當前鏈接 (在 Qt 5.6 添加)。 |
WebEngineView.OpenLinkInNewWindow
|
Open the current link in a new window. Requires a handler for the newWindowRequested () signal. (Added in Qt 5.6) |
WebEngineView.OpenLinkInNewTab
|
Open the current link in a new tab. Requires a handler for the newWindowRequested () signal. (Added in Qt 5.6) |
WebEngineView.CopyLinkToClipboard
|
把當前鏈接拷貝到剪貼闆 (在 Qt 5.6 添加)。 |
WebEngineView.CopyImageToClipboard
|
把點擊圖像拷貝到剪貼闆 (在 Qt 5.6 添加)。 |
WebEngineView.CopyImageUrlToClipboard
|
把點擊圖像的 URL 拷貝到剪貼闆 (在 Qt 5.6 添加)。 |
WebEngineView.CopyMediaUrlToClipboard
|
把懸停音頻 (或視頻) 的 URL 拷貝到剪貼闆 (在 Qt 5.6 添加)。 |
WebEngineView.ToggleMediaControls
|
在展示和隱藏懸停音頻 (或視頻) 元素控件之間觸發 (在 Qt 5.6 添加)。 |
WebEngineView.ToggleMediaLoop
|
觸發懸停音頻 (或視頻)是否應在完成時循環 (在 Qt 5.6 添加)。 |
WebEngineView.ToggleMediaPlayPause
|
觸發懸停音頻 (或視頻) 元素的播放/暫停狀態 (在 Qt 5.6 添加)。 |
WebEngineView.ToggleMediaMute
|
靜音 (或取消靜音) 懸停音頻 (或視頻) 元素 (在 Qt 5.6 添加)。 |
WebEngineView.DownloadLinkToDisk
|
Download the current link to the disk. To implement download actions, connect to the WebEngineProfile.downloadRequested signal. (Added in Qt 5.6) |
WebEngineView.DownloadImageToDisk
|
Download the highlighted image to the disk. (Added in Qt 5.6) |
WebEngineView.DownloadMediaToDisk
|
Download the hovered audio or video to the disk. (Added in Qt 5.6) |
WebEngineView.InspectElement
|
觸發任何附加 Web 審查程序以審查高亮元素 (在 Qt 5.6 添加)。 |
WebEngineView.ExitFullScreen
|
退齣全屏模式 (在 Qt 5.6 添加)。 |
WebEngineView.SavePage
|
Save the current web page to disk. (Added in Qt 5.7) |
WebEngineView.ViewSource
|
Show the source of the current page in a new tab. Requires a handler for the newWindowRequested () signal. (Added in Qt 5.8) |
WebEngineView.ToggleBold
|
觸發選定或光標位置處的粗體。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.ToggleItalic
|
觸發選定或光標位置處的斜體。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.ToggleUnderline
|
觸發選定或光標位置處的下劃綫。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.ToggleStrikethrough
|
觸發選定或光標位置處的刪除綫。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.AlignLeft
|
左對齊行所包含的選定或光標。需要
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.AlignCenter
|
居中對齊行所包含的選定或光標。需要
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.AlignRight
|
右對齊行所包含的選定或光標。需要
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.AlignJustified
|
拉伸包含選定或光標的行,以使每行擁有相等寬度。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.Indent
|
縮進包含選定或光標的行。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.Outdent
|
伸齣包含選定或光標的行。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.InsertOrderedList
|
將有序列錶插入在當前光標位置處,刪除當前選定。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.InsertUnorderedList
|
將無序列錶插入在當前光標位置處,刪除當前選定。要求
contenteditable="true"
(在 Qt 5.10 添加)。
|
WebEngineView.ChangeTextDirectionLTR
|
Changes text direction to left-to-right in the focused input element. (Added in Qt 6.6) |
WebEngineView.ChangeTextDirectionRTL
|
Changes text direction to right-to-left in the focused input element. (Added in Qt 6.6) |
This property was introduced in QtWebEngine 1.2.
|
activeFocusOnPress
:
bool
|
Specifies whether the view should gain active focus when pressed. The default value is
true
.
This property was introduced in QtWebEngine 1.2.
|
audioMuted
:
bool
|
The state of whether the current page audio is muted.
該特性在 QtWebEngine 1.3 引入。
另請參閱 recentlyAudible .
|
backgroundColor
:
color
|
Changes the color of the
WebEngineView
's background, behind the document's body. Can be set to
"transparent"
or to a translucent color to see through the document or to match the web content in a hybrid app to prevent the white flashes that may appear during loading.
默認值為白色。
This property was introduced in QtWebEngine 1.2.
|
canGoBack
:
bool
|
返迴
true
if there are prior session history entries,
false
否則。
|
canGoForward
:
bool
|
返迴
true
if there are subsequent session history entries,
false
否則。
|
contentsSize
:
size
|
Size of the page contents.
該特性在 QtWebEngine 1.3 引入。
|
devToolsId
:
WebEngineView
|
The id of the developer tools host associated with this page.
If remote debugging is enabled (see
Qt WebEngine 開發者工具
), the id can be used to build the URL to connect to the developer tool websocket:
ws://localhost:<debugggin-port>/devtools/page/<id>)
. The websocket can be used to to interact with the page using the
DevTools Protocol
.
This property was introduced in QtWebEngine 6.6.
|
devToolsView
:
WebEngineView
|
The view currently hosting the developer tools for this view. Setting it to a new view will navigate that view to an internal URL with the developer tools, and bind it to this view.
該特性在 QtWebEngine 1.7 引入。
另請參閱 inspectedView .
|
history
:
WebEngineHistory
|
當前視圖的導航曆史。
該特性在 QtWebEngine 1.1 引入。
另請參閱 WebEngineHistory .
|
icon
:
url
|
An internal URL for accessing the currently displayed web site icon, also known as favicon or shortcut icon. This read-only URL corresponds to the image used within a mobile browser application to represent a bookmarked page on the device's home screen.
The following snippet uses the
icon
property to build an
Image
component:
Image { id: appIcon sourceSize: Qt.size(32, 32) source: webView.icon != "" ? webView.icon : "fallbackFavicon.png"; // ... }
指定 Image::sourceSize property informs the Qt WebEngine's favicon provider about the requested size and resizes the icon to it. If Image::sourceSize property is not specified, the provider provides the icon with the largest available resolution.
|
inspectedView
:
WebEngineView
|
The view this view is currently inspecting, if any. Setting it will navigate to an internal URL with the developer tools of the view set.
It is recommended to unset this property when developer tools are not visible; otherwise some debug information may appear in the inspected WebEngineView .
該特性在 QtWebEngine 1.7 引入。
另請參閱 devToolsView .
|
isFullScreen
:
bool
|
返迴
true
if the web view is in fullscreen mode,
false
否則。
該特性在 QtWebEngine 1.1 引入。
另請參閱 fullScreenRequested () 和 fullScreenCancelled ().
|
lifecycleState
:
LifecycleState
|
頁麵的當前生命周期狀態。
以下限定由 setter 實施:
Active
狀態。
Active
狀態。
Discarded
狀態,纔能過渡到
Active
狀態。這會導緻頁麵的重新加載。
這些是對生命周期狀態的唯一硬性限製,另請參閱 recommendedState 瞭解推薦的軟限製。
該特性在 QtWebEngine 1.10 引入。
另請參閱 recommendedState , 頁麵生命周期 API ,和 WebEngine 生命周期範例 .
|
loadProgress
:
int
|
The amount of data from the page that has been loaded, expressed as an integer percentage in the range from
0
to
100
.
|
loading
:
bool
|
返迴
true
if the HTML page is currently loading,
false
否則。
|
mainFrame
:
webEngineFrame
|
The main, top-level frame of the page. All other frames on this page are accessible as children of the main frame.
This property was introduced in QtWebEngine 6.8.
|
profile
:
WebEngineProfile
|
The current profile used for the view.
該特性在 QtWebEngine 1.1 引入。
另請參閱 WebEngineProfile .
|
recentlyAudible
:
bool
|
Returns the current page's audible state (audio was recently played, or not).
該特性在 QtWebEngine 1.3 引入。
另請參閱 audioMuted and recentlyAudibleChanged .
|
recommendedState
:
LifecycleState
|
The recommended limit for the lifecycle state of the page.
把生命周期狀態設為低於推薦狀態的資源使用率狀態可能導緻副作用 (譬如:停止後颱音頻迴放或丟失 HTML 錶單輸入)。不管怎樣,把生命周期狀態設為更高資源狀態是完全安全的。
該特性在 QtWebEngine 1.10 引入。
另請參閱 lifecycleState , 頁麵生命周期 API ,和 WebEngine 生命周期範例 .
|
renderProcessPid
:
qint64
|
Returns the process ID (PID) of the render process assigned to the current page's main frame.
若尚無可用渲染進程,
0
被返迴。
該特性在 QtWebEngine 1.11 引入。
另請參閱 renderProcessPidChanged .
|
scrollPosition
:
point
|
頁麵內容的捲動位置。
該特性在 QtWebEngine 1.3 引入。
|
settings
:
WebEngineSettings
|
Settings used by this view.
該特性在 QtWebEngine 1.1 引入。
另請參閱 WebEngineSettings .
|
title
:
string
|
The title of the currently displayed HTML page. This is a read-only value that reflects the contents of the
<title>
標簽。
|
touchHandleDelegate
:
Component
|
The touchHandleDelegate provides a template defining visual touch handles instantiated by the view whenever touch selection handling is required.
The handle's position, opacity, and visibility are updated automatically. The delegate should be a QML Item or any QML type which inherits it.
注意: If no QML Item is set, the default touch handles will be shown.
The following code uses a custom touch handle delegate:
WebEngineView { // ... touchHandleDelegate: Rectangle { color: "red" } // ... }
The touch handles can be also switched dynamically:
Component {
id: circleTouchHandle
Rectangle {
color: "blue"
radius: 50
}
}
function showDefaultHandle(isDefault) {
if (isDefault)
webEngineView.touchHandleDelegate = circleTouchHandle
else
webEngineView.touchHandleDelegate = null
}
注意: If no delegate is provided, Chromium's default touch handles will appear.
This property was introduced in QtWebEngine 6.4.
|
url : url |
The location of the currently displayed HTML page. This writable property offers the main interface to load a page into a web view. It functions the same as the
window.location
DOM property.
另請參閱 loadHtml ().
|
userScripts
:
WebEngineScriptCollection
|
The user scripts' collection associated with the view.
該特性在 QtWebEngine 1.1 引入。
另請參閱 WebEngineScriptCollection .
|
webChannel
:
QQmlWebChannel
|
The web channel instance used by this view. This channel is automatically using the internal
QtWebEngine
transport mechanism over Chromium IPC, and exposed in the javascript context of the page it is rendering as
qt.webChannelTransport
. This transport object is used when instantiating the JavaScript counterpart of
QWebChannel
使用
Qt WebChannel JavaScript API
.
注意: The view does not take ownership for an assigned webChannel object.
該特性在 QtWebEngine 1.1 引入。
|
webChannelWorld
:
int
|
JavaScript world that the web channel instance used by this view is installed in. The world must be a number between
0
and
256
.
該特性在 QtWebEngine 1.3 引入。
|
zoomFactor
:
real
|
Zoom factor for the view. Valid values are within the range from
0.25
to
5.0
。默認因子為
1.0
.
該特性在 QtWebEngine 1.1 引入。
|
|
This signal is emitted when the value of activeFocusOnPress changes. It specifies whether the view should gain active focus when pressed.
注意:
相應處理程序是
onActiveFocusOnPressChanged
.
該信號在 QtWebEngine 1.2 引入。
另請參閱 activeFocusOnPress and setActiveFocusOnPress ().
|
|
This signal is emitted when the value of muted changes. The value is specified using the audioMuted 特性。
注意: Not to be confused with a specific HTML5 audio / video element being muted.
注意:
相應處理程序是
onAudioMutedChanged
.
該信號在 QtWebEngine 1.3 引入。
另請參閱 audioMuted and recentlyAudibleChanged .
|
|
This signal is emitted when an authentication dialog is requested.
The request can be handled by using the methods of the AuthenticationDialogRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default dialog from showing up. Make sure to call either
AuthenticationDialogRequest::dialogAccept
() 或
AuthenticationDialogRequest::dialogReject
() afterwards.
注意:
相應處理程序是
onAuthenticationDialogRequested
.
該信號在 QtWebEngine 1.4 引入。
|
|
This signal is emitted when the web engine view background color changes.
注意:
相應處理程序是
onBackgroundColorChanged
.
該信號在 QtWebEngine 1.2 引入。
|
|
This signal is emitted when an invalid certificate error, error , is raised while loading a given request.
The certificate error can be handled by using the methods of the WebEngineCertificateError 類型。
注意:
相應處理程序是
onCertificateError
.
該信號在 QtWebEngine 1.1 引入。
|
|
This signal is emitted when a color picker dialog is requested.
The request can be handled by using the methods of the ColorDialogRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default dialog from showing up. Make sure to call either
ColorDialogRequest::dialogAccept
() 或
ColorDialogRequest::dialogReject
() afterwards.
注意:
相應處理程序是
onColorDialogRequested
.
該信號在 QtWebEngine 1.4 引入。
|
|
This signal is emitted when a context menu is requested.
The request can be handled by using the properties of the ContextMenuRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default context menu from showing up.
注意:
相應處理程序是
onContextMenuRequested
.
該信號在 QtWebEngine 1.4 引入。
|
|
This signal is emitted when a web application requests access to the contents of a display.
The request argument holds references to data models for windows and screens available for capturing. To accept the request, the signal handler can call either WebEngineDesktopMediaRequest::selectScreen () 或 WebEngineDesktopMediaRequest::selectWindow ().
注意:
相應處理程序是
onDesktopMediaRequested
.
This signal was introduced in QtWebEngine 6.7.
|
|
This signal is emitted when a file picker dialog is requested.
The request can be handled by using the methods of the FileDialogRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default dialog from showing up. Make sure to call either
FileDialogRequest::dialogAccept
() 或
FileDialogRequest::dialogReject
() afterwards.
注意:
相應處理程序是
onFileDialogRequested
.
該信號在 QtWebEngine 1.4 引入。
|
|
This signal is emitted when a string search on a page is completed. result 是字符串搜索的結果。
注意:
相應處理程序是
onFindTextFinished
.
該信號在 QtWebEngine 1.10 引入。
另請參閱 findText () 和 FindTextResult .
|
|
This signal is emitted when the web page issues the request for fullscreen mode through the JavaScript API.
注意:
相應處理程序是
onFullScreenRequested
.
該信號在 QtWebEngine 1.1 引入。
另請參閱 isFullScreen .
|
|
此信號被發射每當文檔希望把頁麵位置和大小更改為 frameGeometry 。這會發生,例如透過 JavaScript。
While frameGeometry includes, geometry excludes the size of frame margins.
注意: Geometry related properties of QML Window expect a size excluding the window decoration. You have to use geometry 以正確處理此信號。
onGeometryChangeRequested: {
window.x = geometry.x
window.y = geometry.y
window.width = geometry.width
window.height = geometry.height
}
注意:
相應處理程序是
onGeometryChangeRequested
.
該信號在 QtWebEngine 1.7 引入。
|
javaScriptConsoleMessage ( JavaScriptConsoleMessageLevel level , string message , int lineNumber , string sourceID ) |
This signal is emitted when a JavaScript program tries to print a message 到 Web 瀏覽器控製颱。
For example, in case of evaluation errors the source URL may be provided in sourceID as well as the lineNumber .
level indicates the severity of the event that triggered the message, that is, whether it was triggered by an error or a less severe event.
If no handler is specified, the view will log the messages into a
js
日誌類彆
.
注意:
相應處理程序是
onJavaScriptConsoleMessage
.
另請參閱 控製颱日誌 .
|
|
This signal is emitted when a JavaScript dialog is requested.
The request can be handled by using the methods of the JavaScriptDialogRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default dialog from showing up. Make sure to call either
JavaScriptDialogRequest::dialogAccept
() 或
JavaScriptDialogRequest::dialogReject
() afterwards.
注意:
相應處理程序是
onJavaScriptDialogRequested
.
該信號在 QtWebEngine 1.4 引入。
|
linkHovered ( url hoveredUrl ) |
Within a mouse-driven interface, this signal is emitted when a mouse pointer passes over a link, corresponding to the
mouseover
DOM event. This event may also occur in touch interfaces for
mouseover
events that are not cancelled with
preventDefault()
.
hoveredUrl
provides the link's location.
注意:
相應處理程序是
onLinkHovered
.
|
loadingChanged ( WebEngineLoadingInfo loadingInfo ) |
This signal is emitted when a page load begins, ends, or fails.
When handling the signal with
onLoadingChanged
, various read-only parameters are available on the
WebEngineLoadingInfo
指定通過
loadingInfo
.
注意:
相應處理程序是
onLoadingChanged
.
另請參閱 loading , LoadStatus ,和 ErrorDomain .
|
navigationRequested ( WebEngineNavigationRequest request ) |
This signal is emitted when the navigation request request is issued.
注意:
相應處理程序是
onNavigationRequested
.
|
|
此信號發射,當
request
is issued to load a page in a separate web engine view. This can either be because the current page requested it explicitly through a JavaScript call to
window.open
, or because the user clicked on a link while holding Shift, Ctrl, or a built-in combination that triggers the page to open in a new window.
The signal is handled by calling acceptAsNewWindow () on the destination view. If this signal is not handled, the requested load will fail.
An example implementation:
QtObject { id: windowParent // Create the initial browsing windows and open the startup page. Component.onCompleted: { var firstWindow = windowComponent.createObject(windowParent); firstWindow.webView.loadHtml('<input type="button" value="Click!" onclick="window.open("http://qt.io")">'); } property Component windowComponent: Window { // Destroy on close to release the Window's QML resources. // Because it was created with a parent, it won't be garbage-collected. onClosing: destroy() visible: true property WebEngineView webView: webView_ WebEngineView { id: webView_ anchors.fill: parent // Handle the signal. Dynamically create the window and // use its WebEngineView as the destination of our request. onNewWindowRequested: function(request) { var newWindow = windowComponent.createObject(windowParent); newWindow.webView.acceptAsNewWindow(request); } } } }
注意:
相應處理程序是
onNewWindowRequested
.
This signal was introduced in QtWebEngine 2.0.
另請參閱 WebEngineNewWindowRequest and WebEngine Quick 納米瀏覽器 .
|
|
此信號被發射,當把網頁打印成 PDF 文件完成時。
filePath
將包含請求創建的文件路徑,且
success
將是
true
若成功創建文件且
false
否則。
注意:
相應處理程序是
onPdfPrintingFinished
.
該信號在 QtWebEngine 1.5 引入。
另請參閱 printToPdf ().
|
|
This signal is emitted when a web site fires a permission request (e.g. geolocation access, permission to send notifications). The
permission
object can queried for the requesting URL and the
WebEnginePermission.PermissionType
it's asking for, as well as to grant or deny permission.
注意:
相應處理程序是
onPermissionRequested
.
This signal was introduced in QtWebEngine 6.8.
|
|
此信號被發射當 JavaScript
window.print()
method is called on the main frame, or the user pressed the print button of PDF viewer plugin. Typically, the signal handler can simply call
printToPdf
().
由於 QtWebEngine 6.8, this signal is only emitted for the main frame, instead of being emitted for any frame that requests printing.
注意:
相應處理程序是
onPrintRequested
.
該信號在 QtWebEngine 1.8 引入。
另請參閱 printToPdf .
|
|
此信號被發射當 JavaScript
window.print()
方法被調用在
frame
。若框架是主框架,
printRequested
被發射, 取而代之。
注意:
相應處理程序是
onPrintRequestedByFrame
.
This signal was introduced in QtWebEngine 6.8.
另請參閱 printRequested .
|
|
This signal is emitted when the page's audible state, specified by recentlyAudible , is changed, due to audio being played or stopped.
注意: The signal is also emitted when the audioMuted property changes. Also if the audio is paused, this signal is emitted with an approximate 2 秒延遲 ,從音頻被暫停的那一刻起。
If a web page contains two videos that are started in sequence, this signal gets emitted only once, for the first video to generate sound. After both videos are stopped, the signal is emitted upon the last sound generated. This means that the signal is emitted both when any kind of sound is generated and when everything is completely silent within a web page, regardless of the number of audio streams.
Spurious signal emissions might also happen. For example, when sound is stopped, this signal gets emitted first with a value of
true
, and then with a value of
false
. Further, when audio starts playing, the signal is emitted twice with a value of
true
.
注意:
相應處理程序是
onRecentlyAudibleChanged
.
該信號在 QtWebEngine 1.3 引入。
另請參閱 recentlyAudible .
|
|
This signal is emitted when the web page tries to register a custom protocol by issuing a registerProtocolHandler request .
注意:
相應處理程序是
onRegisterProtocolHandlerRequested
.
該信號在 QtWebEngine 1.7 引入。
另請參閱 RegisterProtocolHandlerRequest .
|
|
若尚無可用渲染進程,
0
is returned. This signal is emitted when
pid
(process ID) of the page's underlying render process changed.
注意:
相應處理程序是
onRenderProcessPidChanged
.
該信號在 QtWebEngine 1.11 引入。
另請參閱 renderProcessPid .
|
|
此信號被發射當渲染進程采用非零退齣狀態被終止時。 terminationStatus 是進程的終止狀態,且 exitCode 是進程終止的狀態碼。
注意:
相應處理程序是
onRenderProcessTerminated
.
該信號在 QtWebEngine 1.2 引入。
另請參閱 RenderProcessTerminationStatus .
|
|
This signal is emitted when a web site requests an SSL client certificate, and one or more were found in the system's client certificate store.
處理信號是異步的,且加載會等待直到證書被選中,或上一拷貝 clientCertificateSelection 被銷毀。
若信號未被處理, clientCertificateSelection 被自動銷毀,且將在沒有客戶端證書的情況下繼續加載。
注意:
相應處理程序是
onSelectClientCertificate
.
該信號在 QtWebEngine 1.9 引入。
另請參閱 WebEngineClientCertificateSelection .
|
|
This signal is emitted when the web page sends a request to show a tooltip at a specified position.
注意:
Signal handlers need to call
request.accepted = true
to prevent a default tooltip from showing up.
注意:
相應處理程序是
onTooltipRequested
.
該信號在 QtWebEngine 1.10 引入。
另請參閱 TooltipRequest .
|
|
This signal is emitted when a touch selection menu is requested at a specified position.
The request can be handled by using the methods of the TouchSelectionMenuRequest 類型。
注意:
Signal handlers need to call
request.accepted = true
to prevent a default touch selection menu from showing up.
注意:
相應處理程序是
onTouchSelectionMenuRequested
.
This signal was introduced in QtWebEngine 6.3.
另請參閱 TouchSelectionMenuRequest .
|
|
This signal is emitted when the page's audible state, specified by wasRecentlyAudible , is changed, due to audio being played or stopped.
注意: The signal is also emitted when calling the setAudioMuted method.
注意:
相應處理程序是
onWasRecentlyAudibleChanged
.
該信號在 QtWebEngine 1.3 引入。
|
|
This signal is emitted when a WebAuth authenticator requires user interaction during the authentication process. These requests are handled by displaying a dialog to the user.
The request contains the information and API required to complete the WebAuth UX request.
注意:
相應處理程序是
onWebAuthUxRequested
.
This signal was introduced in QtWebEngine 6.7.
另請參閱 QWebEngineWebAuthUxRequest .
|
|
此信號被發射每當頁麵請求關閉 Web 瀏覽器窗口時,例如透過 JavaScript
window.close()
調用。
注意:
相應處理程序是
onWindowCloseRequested
.
該信號在 QtWebEngine 1.2 引入。
|
|
This signal is emitted whenever the zoom factor for the page changes.
注意:
相應處理程序是
onZoomFactorChanged
.
This signal was introduced in QtWebEngine 6.8.
另請參閱 zoomFactor .
|
void runJavaScript ( string script , int worldId , variant callback ) |
Runs the specified script in the content of the web view.
The callback parameter is optional. If a callback function is provided, it will be invoked after the script finishes running.
runJavaScript("document.title", function(result) { console.log(result); });
僅純數據可以被返迴從 JavaScript 作為結果值。支持的數據類型包括所有 JSON 數據類型,例如,
Date
and
ArrayBuffer
。不支持的數據類型包括,例如,
Function
and
Promise
.
To avoid conflicts with other scripts executed on the page, the world in which the script is run can be specified by
worldId
. The world ID must be between
0
and
256
。若忽略
world
ID,腳本運行在
MainWorld
.
警告: Do not execute lengthy routines in the callback function, because it might block the rendering of the web content.
For more information about injecting scripts, see 腳本注入 . For an alternative way to inject scripts, see WebEngineView::userScripts .
|
|
Handle the newWindowRequested signal by opening the request in this view.
This method was introduced in QtWebEngine 2.0.
另請參閱 newWindowRequested .
|
WebEngineAction action ( WebAction action ) |
返迴 WebEngineAction 為指定 WebAction action . WebEngineView also takes care of implementing the action, so that upon triggering the corresponding action is performed on the view.
var copyAction = webEngineView.action(WebEngineView.Copy);
另請參閱 WebEngineAction .
|
|
返迴框架具有給定 name . If there are multiple frames with the same name, which one is returned is arbitrary. If no frame was found, returns an 無效 frame.
This method was introduced in QtWebEngine 6.8.
|
|
查找指定字符串, subString , in the page. The findTextFinished () 信號被發射當字符串搜索完成時。
要清零搜索高亮,隻需傳遞空字符串。
該方法在 QtWebEngine 1.1 引入。
另請參閱 findTextFinished ().
|
|
查找指定字符串, subString ,在頁麵使用給定 options 。 findTextFinished () 信號被發射當字符串搜索完成時。
要清零搜索高亮,隻需傳遞空字符串。
findText("Qt", WebEngineView.FindBackward | WebEngineView.FindCaseSensitively);
該方法在 QtWebEngine 1.1 引入。
另請參閱 findTextFinished ().
|
|
查找指定字符串, subString ,在頁麵使用給定 options 。 findTextFinished () 信號被發射當字符串搜索完成時。
要清零搜索高亮,隻需傳遞空字符串。
The resultCallback must take an integer parameter. It will be called with the number of found occurrences of the subString .
findText("Qt", WebEngineView.FindCaseSensitively, function(matchCount) { if (matchCount > 0) console.log("'Qt' tokens found:", matchCount); });
該方法在 QtWebEngine 1.1 引入。
另請參閱 findTextFinished ().
|
|
Immediately sets
isFullScreen
特性到
false
. It can be used to notify the browser engine when the windowing system forces the application to leave fullscreen mode.
ApplicationWindow { onVisibilityChanged: { if (webEngineView.isFullScreen && visibility != Window.FullScreen) webEngineView.fullScreenCancelled() } WebEngineView { id: webEngineView // ... } }
該方法在 QtWebEngine 1.1 引入。
另請參閱 isFullScreen and fullScreenRequested ().
|
void goBack () |
Go backward within the browser's session history, if possible. This function is equivalent to the
window.history.back()
DOM method.
另請參閱 canGoBack .
|
|
若 offset is positive, goes forward the specified number of offset pages in the current session history. If offset is negative, it goes back. If the offset is invalid, the page is not changed.
該方法在 QtWebEngine 1.1 引入。
另請參閱 goBack () 和 goForward ().
|
void goForward () |
Go forward within the browser's session history, if possible. This function is equivalent to the
window.history.forward()
DOM method.
加載指定 html as the content of the web view.
This method offers a lower-level alternative to the
url
property, which references HTML pages via URL.
baseUrl
可選且用於解析文檔中的相對 URL (譬如:圖像或樣式錶引用)。例如,若
html
檢索自
http://www.example.com/documents/overview.html
,其是基 URL,然後相對 URL 引用圖像,
diagram.png
,應該在
http://www.example.com/documents/diagram.png
.
另請參閱 url .
|
|
Prints the WebEngineView 's current content to a PDF document and stores it under filePath . The document's size will be determined by the value of pageSizeId and its orientation will be determined using orientation .
為將網頁打印成 PDF,此方法發齣異步請求,並立即返迴。要通報請求的有關結果,連接到信號 pdfPrintingFinished ().
If you leave out
pageSizeId
, it defaults to
A4
. If you leave out
orientation
, it defaults to
Portrait
.
該方法在 QtWebEngine 1.3 引入。
另請參閱 pdfPrintingFinished ().
|
|
Prints the WebEngineView 's current content to a PDF document and returns it in a byte array. The document's size will be determined by the value of pageSizeId and its orientation will be determined using orientation .
The resultCallback must take a string parameter. This string will contain the document's data upon successful printing and an empty string otherwise.
If you leave out
pageSizeId
, it defaults to
A4
. If you leave out
orientation
, it defaults to
Portrait
.
該方法在 QtWebEngine 1.3 引入。
|
void reload () |
Reloads the current page. This function is equivalent to the
window.location.reload()
DOM method.
另請參閱 reloadAndBypassCache ().
|
|
Reloads the current page, ignoring any cached content.
該方法在 QtWebEngine 1.1 引入。
另請參閱 reload ().
|
|
替換當前拼寫錯誤單詞采用 replacement .
該方法在 QtWebEngine 1.3 引入。
|
|
Save the current web page to disk.
網頁被保存到 filePath 以指定 format .
This is a shortcut for the following actions:
此函數為網頁發齣異步下載請求,並立即返迴。
This method was introduced in QtWebEngine 6.6.
另請參閱 QWebEngineDownloadRequest::SavePageFormat .
|
|
Sets active focus to a clicked web engine view if
arg
is
true
. By setting it to
false
, a web engine view can be used to create a UI element that should not get focus. This can be useful in a hybrid UI.
該方法在 QtWebEngine 1.2 引入。
另請參閱 activeFocusOnPress , activeFocusOnPressChanged ,和 WebEngineSettings::focusOnNavigationEnabled .
|
void stop () |
停止加載當前頁麵。
|
|
觸發 Web 動作 action .
該方法在 QtWebEngine 1.2 引入。
另請參閱 WebAction .