QWebEngineContextMenuData

The QWebEngineContextMenuData class provides context data for populating or extending a context menu with actions. More

Inheritance diagram of PySide2.QtWebEngineWidgets.QWebEngineContextMenuData

Synopsis

Functions

Detailed Description

QWebEngineContextMenuData is returned by contextMenuData() 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 PySide2.QtWebEngineWidgets.QWebEngineContextMenuData

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData(other)

param other:

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData

Constructs null context menu data.

Constructs context menu data from other .

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.MediaType

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

Constant

Description

QWebEngineContextMenuData.MediaTypeNone

The context is not a media type.

QWebEngineContextMenuData.MediaTypeImage

The context is an image element.

QWebEngineContextMenuData.MediaTypeVideo

The context is a video element.

QWebEngineContextMenuData.MediaTypeAudio

The context is an audio element.

QWebEngineContextMenuData.MediaTypeCanvas

The context is a canvas element.

QWebEngineContextMenuData.MediaTypeFile

The context is a file.

QWebEngineContextMenuData.MediaTypePlugin

The context is a plugin element.

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.MediaFlag

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

Constant

Description

QWebEngineContextMenuData.MediaInError

An error occurred.

QWebEngineContextMenuData.MediaPaused

Media is paused.

QWebEngineContextMenuData.MediaMuted

Media is muted.

QWebEngineContextMenuData.MediaLoop

Media can be looped.

QWebEngineContextMenuData.MediaCanSave

Media can be saved.

QWebEngineContextMenuData.MediaHasAudio

Media has audio.

QWebEngineContextMenuData.MediaCanToggleControls

Media can show controls.

QWebEngineContextMenuData.MediaControls

Media controls are shown.

QWebEngineContextMenuData.MediaCanPrint

Media is printable.

QWebEngineContextMenuData.MediaCanRotate

Media is rotatable.

New in version 5.11.

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.EditFlag

The available edit operations in the current context.

Constant

Description

QWebEngineContextMenuData.CanUndo

Undo is available.

QWebEngineContextMenuData.CanRedo

Redo is available.

QWebEngineContextMenuData.CanCut

Cut is available.

QWebEngineContextMenuData.CanCopy

Copy is available.

QWebEngineContextMenuData.CanPaste

Paste is available.

QWebEngineContextMenuData.CanDelete

Delete is available.

QWebEngineContextMenuData.CanSelectAll

Select All is available.

QWebEngineContextMenuData.CanTranslate

Translate is available.

QWebEngineContextMenuData.CanEditRichly

Context is richly editable.

New in version 5.11.

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.editFlags()
Return type:

EditFlags

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.isContentEditable()
Return type:

bool

Returns true if the content is editable by the user; otherwise returns false .

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.isValid()
Return type:

bool

Returns true if the context data is valid; otherwise returns false .

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.linkText()
Return type:

str

Returns the text of a link if the context is a link.

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.linkUrl()
Return type:

PySide2.QtCore.QUrl

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.mediaFlags()
Return type:

MediaFlags

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.mediaType()
Return type:

MediaType

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.mediaUrl()
Return type:

PySide2.QtCore.QUrl

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.misspelledWord()
Return type:

str

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

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.position()
Return type:

PySide2.QtCore.QPoint

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

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.selectedText()
Return type:

str

Returns the selected text of the context.

PySide2.QtWebEngineWidgets.QWebEngineContextMenuData.spellCheckerSuggestions()
Return type:

list of strings

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