QWebEngineContextMenuRequest#

The QWebEngineContextMenuRequest class provides request for populating or extending a context menu with actions. More

Inheritance diagram of PySide6.QtWebEngineCore.QWebEngineContextMenuRequest

Synopsis#

Properties#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QWebEngineContextMenuRequest is returned by lastContextMenuRequest() after a context menu event, and contains information about where the context menu event took place. This is also in the context in which any context specific WebAction will be performed.

class PySide6.QtWebEngineCore.QWebEngineContextMenuRequest#

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.accepted: bool#

This property holds Whether the request is accepted..

Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.editFlags: Combination of QWebEngineContextMenuRequest.EditFlag#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.isContentEditable: bool#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.linkText: str#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.linkUrl: PySide6.QtCore.QUrl#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaFlags: Combination of QWebEngineContextMenuRequest.MediaFlag#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaType: MediaType#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaUrl: PySide6.QtCore.QUrl#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.misspelledWord: str#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.position: PySide6.QtCore.QPoint#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.selectedText: str#
Access functions:
property PᅟySide6.QtWebEngineCore.QWebEngineContextMenuRequest.spellCheckerSuggestions: list of strings#
Access functions:
PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.MediaType#

This enum describes the media type of the context menu request if any.

Constant

Description

QWebEngineContextMenuRequest.MediaTypeNone

The context is not a media type.

QWebEngineContextMenuRequest.MediaTypeImage

The context is an image element.

QWebEngineContextMenuRequest.MediaTypeVideo

The context is a video element.

QWebEngineContextMenuRequest.MediaTypeAudio

The context is an audio element.

QWebEngineContextMenuRequest.MediaTypeCanvas

The context is a canvas element.

QWebEngineContextMenuRequest.MediaTypeFile

The context is a file.

QWebEngineContextMenuRequest.MediaTypePlugin

The context is a plugin element.

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.MediaFlag#

(inherits enum.Flag) The current media element’s status and its available operations. MediaNone if the selected web page content is not a media element.

Constant

Description

QWebEngineContextMenuRequest.MediaInError

An error occurred.

QWebEngineContextMenuRequest.MediaPaused

Media is paused.

QWebEngineContextMenuRequest.MediaMuted

Media is muted.

QWebEngineContextMenuRequest.MediaLoop

Media can be looped.

QWebEngineContextMenuRequest.MediaCanSave

Media can be saved.

QWebEngineContextMenuRequest.MediaHasAudio

Media has audio.

QWebEngineContextMenuRequest.MediaCanToggleControls

Media can show controls.

QWebEngineContextMenuRequest.MediaControls

Media controls are shown.

QWebEngineContextMenuRequest.MediaCanPrint

Media is printable.

QWebEngineContextMenuRequest.MediaCanRotate

Media is rotatable.

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.EditFlag#

(inherits enum.Flag) The available edit operations in the current context menu request.

Constant

Description

QWebEngineContextMenuRequest.CanUndo

Undo is available.

QWebEngineContextMenuRequest.CanRedo

Redo is available.

QWebEngineContextMenuRequest.CanCut

Cut is available.

QWebEngineContextMenuRequest.CanCopy

Copy is available.

QWebEngineContextMenuRequest.CanPaste

Paste is available.

QWebEngineContextMenuRequest.CanDelete

Delete is available.

QWebEngineContextMenuRequest.CanSelectAll

Select All is available.

QWebEngineContextMenuRequest.CanTranslate

Translate is available.

QWebEngineContextMenuRequest.CanEditRichly

Context is richly editable.

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.editFlags()#
Return type:

Combination of QWebEngineContextMenuRequest.EditFlag

Returns the available edit operations in the current context or CanDoNone if no actions are available.

Getter of property editFlags .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.isAccepted()#
Return type:

bool

Getter of property accepted .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.isContentEditable()#
Return type:

bool

Returns true if the context menu request is editable by the user; otherwise returns false.

Getter of property isContentEditable .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.linkText()#
Return type:

str

Returns the text of a link if the context menu request was requested for a link.

Getter of property linkText .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.linkUrl()#
Return type:

PySide6.QtCore.QUrl

Returns the URL of a link if the menu context request is a link. It is not guaranteed to be a valid URL.

Getter of property linkUrl .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaFlags()#
Return type:

Combination of QWebEngineContextMenuRequest.MediaFlag

Returns the current media element’s status and its available operations. MediaNone if the selected web page content is not a media element.

Getter of property mediaFlags .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaType()#
Return type:

MediaType

Returns the type of the media element or MediaTypeNone if the context menu requestis not a media element.

Getter of property mediaType .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.mediaUrl()#
Return type:

PySide6.QtCore.QUrl

If the context menu request is a media element, returns the URL of that media.

Getter of property mediaUrl .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.misspelledWord()#
Return type:

str

If the menu context request is a word considered misspelled by the spell-checker, returns the misspelled word.

For possible replacements of the word, see spellCheckerSuggestions() .

Getter of property misspelledWord .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.position()#
Return type:

PySide6.QtCore.QPoint

Returns the position of the context menu request, usually the mouse position where the context menu event was triggered.

Getter of property position .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.selectedText()#
Return type:

str

Returns the selected text of the context menu request.

Getter of property selectedText .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.setAccepted(accepted)#
Parameters:

accepted – bool

See also

isAccepted()

Setter of property accepted .

PySide6.QtWebEngineCore.QWebEngineContextMenuRequest.spellCheckerSuggestions()#
Return type:

list of strings

If the menu context request is a word considered misspelled by the spell-checker, returns a list of suggested replacements for misspelledWord() .

Getter of property spellCheckerSuggestions .