WebEnginePage
Qt Base Class: QWebEnginePage
Signature: QWebEnginePage(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None
QWebEnginePage(self, profile: PySide6.QtWebEngineCore.QWebEngineProfile, parent: Optional[PySide6.QtCore.QObject] = None) -> None
Base classes
Name | Children | Inherits |
---|---|---|
ObjectMixin prettyqt.core.object |
||
QWebEnginePage PySide6.QtWebEngineCore QWebEnginePage(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None |
⋔ Inheritance diagram
graph TD
1473574738592["webenginecore.WebEnginePage"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473574700528["QtWebEngineCore.QWebEnginePage"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473299815024 --> 1473574738592
140713234304496 --> 1473299815024
1473574700528 --> 1473574738592
1473288842240 --> 1473574700528
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
🛈 DocStrings
Bases: ObjectMixin
, QWebEnginePage
A web engine page holds the HTML document contents, link history + actions.
Source code in prettyqt\webenginecore\webenginepage.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
|
find_text(string: str, backward: bool = False, case_sensitive: bool = False, callback: Callable[[bool], None] | None = None)
Find text in the current page.
Finds the specified string, subString, in the page, using the given options. The findTextFinished() signal is emitted when a string search is completed.
To clear the search highlight, just pass an empty string.
The resultCallback must take a boolean parameter. It will be called with a value of true if the subString was found; otherwise the callback value will be false.
Warning: It is guaranteed that the callback is always called, but it might be done during page destruction. When WebEnginePage is deleted, the callback is triggered with an invalid value and it is not safe to use the corresponding QWebEnginePage or QWebEnginePage instance inside it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
string |
str
|
string to search for |
required |
backward |
bool
|
search backwards |
False
|
case_sensitive |
bool
|
case-sensitive search |
False
|
callback |
Callable[[bool], None] | None
|
result callback |
None
|
Source code in prettyqt\webenginecore\webenginepage.py
get_icon() -> gui.Icon | None
get_lifecycle_state() -> LifecycleStateStr
get_scripts() -> webenginecore.WebEngineScriptCollection
get_setting(setting_name: webenginecore.webenginesettings.WebAttributeStr) -> bool
Return value of given WebEngine setting.
get_settings() -> webenginecore.WebEngineSettings
insert_stylesheet(name: str, css: str | os.PathLike, immediately: bool = True)
Load css using JavaScript.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
CSS id |
required |
css |
str | PathLike
|
CSS stylesheet, either a string or a PathLike object. |
required |
immediately |
bool
|
whther to run javascript immediately |
True
|
Source code in prettyqt\webenginecore\webenginepage.py
load_url(url: datatypes.UrlType | datatypes.PathType)
Load the URL.
Loads the specified url and displays it.
Note: The Page remains the same until enough data has arrived to display the new URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
UrlType | PathType
|
URL to load |
required |
Source code in prettyqt\webenginecore\webenginepage.py
mousedown(selector: str, btn: Literal['left', 'middle', 'right'])
Simulate a mousedown event on the targeted element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selector |
str
|
A CSS3 selector to targeted element |
required |
btn |
Literal['left', 'middle', 'right']
|
Mouse button |
required |
Source code in prettyqt\webenginecore\webenginepage.py
open_in_browser()
set_feature_permission(url: datatypes.UrlType, feature: FeatureStr | mod.Feature, policy: PermissionPolicyStr | mod.PermissionPolicy)
Set permission of feature for given URL.
Source code in prettyqt\webenginecore\webenginepage.py
set_input_value(selector: str, value: str)
Set the value of the input matched by given selector.
set_lifecycle_state(state: LifecycleStateStr | mod.LifecycleState)
Set lifecycle state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state |
LifecycleStateStr | LifecycleState
|
lifecycle state |
required |
set_setting(setting_name: webenginecore.webenginesettings.WebAttributeStr, value: bool)
set_url(url: datatypes.PathType | datatypes.UrlType)
Set the url of the WebEnginePage.
Clears the Page and loads the URL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
PathType | UrlType
|
URL to set |
required |
set_zoom(zoom: float)
Set the zoom factor for the Page.
Valid values are within the range from 0.25 to 5.0. The default factor is 1.0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zoom |
float
|
Zoom factor |
required |
trigger_action(action: WebActionStr | mod.WebAction, checked: bool = False)
⌗ Property table
Qt Property | Type | Doc |
---|---|---|
objectName |
QString | |
selectedText |
QString | |
hasSelection |
bool | |
requestedUrl |
QUrl | |
zoomFactor |
double | |
title |
QString | |
url |
QUrl | |
iconUrl |
QUrl | |
icon |
QIcon | |
backgroundColor |
QColor | |
contentsSize |
QSizeF | |
scrollPosition |
QPointF | |
audioMuted |
bool | |
recentlyAudible |
bool | |
visible |
bool | |
lifecycleState |
QWebEnginePage::LifecycleState | |
recommendedState |
QWebEnginePage::LifecycleState | |
renderProcessPid |
qlonglong | |
loading |
bool |