The QWebEngineContextMenuData class provides context data for populating or extending a context menu with actions. More...
Header: | #include <QWebEngineContextMenuData> |
qmake: | QT += webenginewidgets |
Since: | Qt 5.7 |
This class was introduced in Qt 5.7.
enum | EditFlag { CanUndo, CanRedo, CanCut, CanCopy, CanPaste, …, CanEditRichly } |
flags | EditFlags |
enum | MediaFlag { MediaInError, MediaPaused, MediaMuted, MediaLoop, MediaCanSave, …, MediaCanRotate } |
flags | MediaFlags |
enum | MediaType { MediaTypeNone, MediaTypeImage, MediaTypeVideo, MediaTypeAudio, MediaTypeCanvas, …, MediaTypePlugin } |
QWebEngineContextMenuData(const QWebEngineContextMenuData &other) | |
QWebEngineContextMenuData() | |
QWebEngineContextMenuData & | operator=(const QWebEngineContextMenuData &other) |
~QWebEngineContextMenuData() | |
QWebEngineContextMenuData::EditFlags | editFlags() const |
bool | isContentEditable() const |
bool | isValid() const |
QString | linkText() const |
QUrl | linkUrl() const |
QWebEngineContextMenuData::MediaFlags | mediaFlags() const |
QWebEngineContextMenuData::MediaType | mediaType() const |
QUrl | mediaUrl() const |
QString | misspelledWord() const |
QPoint | position() const |
QString | selectedText() const |
QStringList | spellCheckerSuggestions() const |
QWebEngineContextMenuData is returned by QWebEnginePage::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 QWebEnginePage::WebAction will be performed.
The available edit operations in the current context.
Constant | Value | Description |
---|---|---|
QWebEngineContextMenuData::CanUndo |
0x1 |
Undo is available. |
QWebEngineContextMenuData::CanRedo |
0x2 |
Redo is available. |
QWebEngineContextMenuData::CanCut |
0x4 |
Cut is available. |
QWebEngineContextMenuData::CanCopy |
0x8 |
Copy is available. |
QWebEngineContextMenuData::CanPaste |
0x10 |
Paste is available. |
QWebEngineContextMenuData::CanDelete |
0x20 |
Delete is available. |
QWebEngineContextMenuData::CanSelectAll |
0x40 |
Select All is available. |
QWebEngineContextMenuData::CanTranslate |
0x80 |
Translate is available. |
QWebEngineContextMenuData::CanEditRichly |
0x100 |
Context is richly editable. |
This enum was introduced or modified in Qt 5.11.
The EditFlags type is a typedef for QFlags<EditFlag>. It stores an OR combination of EditFlag values.
The current media element's status and its available operations. MediaNone
if the selected web page content is not a media element.
Constant | Value | Description |
---|---|---|
QWebEngineContextMenuData::MediaInError |
0x1 |
An error occurred. |
QWebEngineContextMenuData::MediaPaused |
0x2 |
Media is paused. |
QWebEngineContextMenuData::MediaMuted |
0x4 |
Media is muted. |
QWebEngineContextMenuData::MediaLoop |
0x8 |
Media can be looped. |
QWebEngineContextMenuData::MediaCanSave |
0x10 |
Media can be saved. |
QWebEngineContextMenuData::MediaHasAudio |
0x20 |
Media has audio. |
QWebEngineContextMenuData::MediaCanToggleControls |
0x40 |
Media can show controls. |
QWebEngineContextMenuData::MediaControls |
0x80 |
Media controls are shown. |
QWebEngineContextMenuData::MediaCanPrint |
0x100 |
Media is printable. |
QWebEngineContextMenuData::MediaCanRotate |
0x200 |
Media is rotatable. |
This enum was introduced or modified in Qt 5.11.
The MediaFlags type is a typedef for QFlags<MediaFlag>. It stores an OR combination of MediaFlag values.
This enum describes the media type of the context if any.
Constant | Value | Description |
---|---|---|
QWebEngineContextMenuData::MediaTypeNone |
0 |
The context is not a media type. |
QWebEngineContextMenuData::MediaTypeImage |
1 |
The context is an image element. |
QWebEngineContextMenuData::MediaTypeVideo |
2 |
The context is a video element. |
QWebEngineContextMenuData::MediaTypeAudio |
3 |
The context is an audio element. |
QWebEngineContextMenuData::MediaTypeCanvas |
4 |
The context is a canvas element. |
QWebEngineContextMenuData::MediaTypeFile |
5 |
The context is a file. |
QWebEngineContextMenuData::MediaTypePlugin |
6 |
The context is a plugin element. |
Constructs context menu data from other.
Constructs null context menu data.
Assigns the other context menu data to this.
Destroys the context menu data.
Returns the available edit operations in the current context or CanDoNone
if no actions are available.
Returns true
if the content is editable by the user; otherwise returns false
.
Returns true
if the context data is valid; otherwise returns false
.
Returns the text of a link if the context is a link.
Returns the URL of a link if the context is a link. It is not guaranteed to be a valid URL.
Returns the current media element's status and its available operations. MediaNone
if the selected web page content is not a media element.
Returns the type of the media element or MediaTypeNone
if the context is not a media element.
If the context is a media element, returns the URL of that media.
If the context is a word considered misspelled by the spell-checker, returns the misspelled word.
For possible replacements of the word, see spellCheckerSuggestions().
This function was introduced in Qt 5.8.
Returns the position of the context, usually the mouse position where the context menu event was triggered.
Returns the selected text of the context.
If the context is a word considered misspelled by the spell-checker, returns a list of suggested replacements for misspelledWord().
This function was introduced in Qt 5.8.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qwebenginecontextmenudata.html