- Qt 6.11
- Qt WebEngine
- QML Types
- TouchSelectionMenuRequest
- Qt 6.11.1 Reference Documentation

# TouchSelectionMenuRequest QML Type

A request for showing a touch selection menu. More...

Import Statement: | `import QtWebEngine`
Since: | QtWebEngine 6.3

- List of all members, including inherited members

## Enumerations

- TouchSelectionCommandFlags `(since QtWebEngine 6.3)`

## Properties

- accepted : bool
- selectionBounds : rect
- touchSelectionCommandFlags : TouchSelectionCommandFlags `(since QtWebEngine 6.3)`

## Detailed Description

A TouchSelectionMenuRequest is passed as an argument of the WebEngineView::touchSelectionMenuRequest signal. It provides further information about the context of the request. The selectionBounds property provides the origin of the request.

The accepted property of the request indicates whether the request is handled by the user code or the default touch selection menu should be displayed.

The following code uses a custom menu to handle the request:

     WebEngineView {
         id: view
         // ...
         onTouchSelectionMenuRequested: function(request) {
             request.accepted = true;
             myMenu.x = request.selectionBounds.x;
             myMenu.y = request.selectionBounds.y;
             myMenu.trigger.connect(view.triggerWebAction);
             myMenu.popup();
         }
         // ...
     }

## Enumeration Documentation

### `[since QtWebEngine 6.3]` TouchSelectionCommandFlags

Note: In the default touch selection menu, showing the context menu is always available as a separate action.

Constant | Description
--- | ---
`TouchSelectionMenuRequest.Cut` | Cut is available.
`TouchSelectionMenuRequest.Copy` | Copy is available.
`TouchSelectionMenuRequest.Paste` | Paste is available.

This documentation was introduced in QtWebEngine 6.3.

## Property Documentation

### accepted : bool

Indicates whether the touch selection menu request has been handled by the signal handler.

If the property is `false` after any signal handlers for WebEngineView::touchSelectionMenuRequested have been executed, a default touch selection menu will be shown. To prevent this, set `request.accepted` to `true`.

The default is `false`.

Note: The default content of the touch selection menu depends on the web element for which the request was actually generated.

### selectionBounds : rect `[read-only]`

The position of the bound rectangle from the touch text selection.

### touchSelectionCommandFlags : TouchSelectionCommandFlags `[read-only, since QtWebEngine 6.3]`

The available operations in the current touch selection menu request.

This property was introduced in QtWebEngine 6.3.