webenginecore
Class info
Classes
| Name | Children | Inherits |
|---|---|---|
| WebEngineContextMenuRequest prettyqt.webenginecore.webenginecontextmenurequest |
||
| WebEngineDownloadRequest prettyqt.webenginecore.webenginedownloadrequest |
||
| WebEngineHistory prettyqt.webenginecore.webenginehistory |
||
| WebEngineHistoryItem prettyqt.webenginecore.webenginehistoryitem |
||
| WebEngineHttpRequest prettyqt.webenginecore.webenginehttprequest |
||
| WebEnginePage prettyqt.webenginecore.webenginepage A web engine page holds the HTML document contents, link history + actions. |
||
| WebEnginePermission prettyqt.webenginecore.webenginepermission Represents a permission request or stored permission for a web origin. |
||
| WebEngineProfile prettyqt.webenginecore.webengineprofile |
||
| WebEngineScript prettyqt.webenginecore.webenginescript |
||
| WebEngineScriptCollection prettyqt.webenginecore.webenginescriptcollection |
||
| WebEngineSettings prettyqt.webenginecore.webenginesettings |
||
| WebEngineUrlScheme prettyqt.webenginecore.webengineurlscheme |
||
| WebEngineUrlSchemeHandler prettyqt.webenginecore.webengineurlschemehandler |
|
🛈 DocStrings
Classes and functions for embedding web content in applications.
WebEngineContextMenuRequest
Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
can_copy() -> bool
can_cut() -> bool
can_delete() -> bool
can_edit_richly() -> bool
can_paste() -> bool
can_redo() -> bool
can_select_all() -> bool
can_translate() -> bool
can_undo() -> bool
get_edit_flags() -> list[EditFlagStr]
get_media_flags() -> list[MediaFlagStr]
WebEngineDownloadRequest
Source code in prettyqt/webenginecore/webenginedownloadrequest.py
get_interrupt_reason() -> DownloadInterruptReasonStr
get_save_page_format() -> SavePageFormatStr
Return current save page format.
get_state() -> DownloadStateStr
set_save_page_format(fmt: SavePageFormatStr | Item.SavePageFormat)
Set the save page format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt
|
SavePageFormatStr | SavePageFormat
|
save page format for the layout |
required |
Source code in prettyqt/webenginecore/webenginedownloadrequest.py
WebEngineHistory
Source code in prettyqt/webenginecore/webenginehistory.py
get_items() -> list[webenginecore.WebEngineHistoryItem]
WebEngineHttpRequest
Bases: QWebEngineHttpRequest
Source code in prettyqt/webenginecore/webenginehttprequest.py
get_method() -> MethodStr
set_method(method: MethodStr | QtWebEngineCore.QWebEngineHttpRequest.Method)
Set method this WebEngine request is using.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
MethodStr | Method
|
method |
required |
WebEnginePage
Bases: ObjectMixin, QWebEnginePage
A web engine page holds the HTML document contents, link history + actions.
Source code in prettyqt/webenginecore/webenginepage.py
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 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
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[str], immediately: bool = True)
Load css using JavaScript.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
CSS id |
required |
css
|
str | PathLike[str]
|
CSS stylesheet, either a string or a PathLike object. |
required |
immediately
|
bool
|
whether 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()
Open page URL in default system 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)
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)
WebEnginePermission
Bases: QWebEnginePermission
Represents a permission request or stored permission for a web origin.
Source code in prettyqt/webenginecore/webenginepermission.py
get_origin() -> core.Url
get_permission_type() -> PermissionTypeStr
get_state() -> StateStr
is_persistent(permission_type: PermissionTypeStr | mod.PermissionType) -> bool
classmethod
Return whether the given permission type is persistent.
Source code in prettyqt/webenginecore/webenginepermission.py
WebEngineProfile
Bases: ObjectMixin, QWebEngineProfile
Source code in prettyqt/webenginecore/webengineprofile.py
get_http_cache_type() -> HttpCacheTypeStr
get_persistent_cookie_policy() -> PersistentCookiePolicyStr
install_url_scheme_handler(scheme: str, callback: Callable[[QWebEngineUrlRequestJob], Any])
Install a URL scheme handler.
Source code in prettyqt/webenginecore/webengineprofile.py
set_http_cache_type(typ: HttpCacheTypeStr | mod.HttpCacheType)
Set the http cache type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
HttpCacheTypeStr | HttpCacheType
|
http cache type |
required |
set_persistent_cookie_policy(policy: PersistentCookiePolicyStr | mod.PersistentCookiesPolicy)
WebEngineScript
Bases: QWebEngineScript
Source code in prettyqt/webenginecore/webenginescript.py
get_injection_point() -> InjectionPointStr
set_injection_point(point: InjectionPointStr | QtWebEngineCore.QWebEngineScript.InjectionPoint)
Set injection point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
InjectionPointStr | InjectionPoint
|
injection point to use |
required |
Source code in prettyqt/webenginecore/webenginescript.py
WebEngineSettings
Bases: MutableMapping
Source code in prettyqt/webenginecore/webenginesettings.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 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 | |
get_font_family(family: FontFamilyStr | QtWebEngineCore.QWebEngineSettings.FontFamily) -> str
Return the actual font family for the specified generic font family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
FontFamilyStr | FontFamily
|
generic font family |
required |
Source code in prettyqt/webenginecore/webenginesettings.py
get_font_size(typ: FontSizeStr | QtWebEngineCore.QWebEngineSettings.FontSize) -> int
Return the default font size for type in pixels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
FontSizeStr | FontSize
|
font size type |
required |
Source code in prettyqt/webenginecore/webenginesettings.py
get_unknown_url_scheme_policy() -> UnknownUrlSchemePolicyStr
Return current unknown url scheme policy.
Source code in prettyqt/webenginecore/webenginesettings.py
set_font_family(which: FontFamilyStr | QtWebEngineCore.QWebEngineSettings.FontFamily, family: str)
Set the actual font family to family for the specified generic family, which.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
which
|
FontFamilyStr | FontFamily
|
family to set |
required |
family
|
str
|
generic family |
required |
Source code in prettyqt/webenginecore/webenginesettings.py
set_font_size(typ: FontSizeStr | QtWebEngineCore.QWebEngineSettings.FontSize, size: int)
Set the font size for type to size in pixels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
typ
|
FontSizeStr | FontSize
|
font size type |
required |
size
|
int
|
size in pixels |
required |
Source code in prettyqt/webenginecore/webenginesettings.py
set_unknown_url_scheme_policy(policy: UnknownUrlSchemePolicyStr | pol)
Set the unknown url scheme policy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
UnknownUrlSchemePolicyStr | pol
|
unknown url scheme policy |
required |
Source code in prettyqt/webenginecore/webenginesettings.py
WebEngineUrlScheme
Bases: QWebEngineUrlScheme
Source code in prettyqt/webenginecore/webengineurlscheme.py
get_syntax() -> SyntaxStr
set_syntax(syntax: SyntaxStr | QWebEngineUrlScheme.Syntax)
Set syntax.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
syntax
|
SyntaxStr | Syntax
|
syntax to use |
required |