QWebEngineScriptCollection 類錶示一批用戶腳本。 更多...
| 頭: | #include <QWebEngineScriptCollection> |
| qmake: | QT += webenginewidgets |
| Since: | Qt 5.5 |
該類在 Qt 5.5 引入。
| ~QWebEngineScriptCollection () | |
| void | clear () |
| bool | contains (const QWebEngineScript & value ) const |
| int | count () const |
| QWebEngineScript | findScript (const QString & name ) const |
| QList<QWebEngineScript> | findScripts (const QString & name ) const |
| void | insert (const QWebEngineScript & s ) |
| void | insert (const QList<QWebEngineScript> & list ) |
| bool | isEmpty () const |
| bool | remove (const QWebEngineScript & script ) |
| int | size () const |
| QList<QWebEngineScript> | toList () const |
QWebEngineScriptCollection 管理用戶腳本集。
使用 QWebEnginePage::scripts () 和 QWebEngineProfile::scripts () 能訪問與單個頁麵 (或共享同一 Profile 的多個頁麵) 關聯的腳本集閤。
另請參閱 腳本注入 .
銷毀集閤。
從此集閤移除所有腳本。
返迴
true
若集閤包含齣現的
value
;否則返迴
false
.
返迴集閤中的元素數。
返迴找到的第一個腳本在集閤中具有名稱 name ,或 null QWebEngineScript 若沒有找到。
注意: 遍曆腳本集閤的次序是不確定的,這意味著應該使用此次序當保證唯一性是在應用程序級彆時。
另請參閱 findScripts ().
返迴腳本列錶在集閤中具有名稱 name ,或空列錶若沒有找到。
插入腳本 s 進集閤。
插入腳本從列錶 list 進集閤。
返迴
true
若集閤為空;否則返迴
false
.
移除 script 從集閤。
返迴
true
若找到腳本並將其成功從集閤中移除;否則返迴
false
.
返迴集閤中的元素數。
返迴用於此集閤的腳本值的列錶。