FormValidationMessageRequest QML Type

A request for showing a HTML5 form validation message to the user. More...

Import Statement: import QtWebEngine 1.5
Since: QtWebEngine 1.4


Detailed Description

A FormValidationMessageRequest is passed as an argument of the WebEngineView::formValidationMessageRequested signal. It is generated when the handling of the validation message is requested.

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

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

WebEngineView {
    // ...
    onFormValidationMessageRequested: function(request) {
        request.accepted = true;
        switch (request.type) {
            case FormValidationMessageRequest.Show:
                validationMessage.text = request.text;
                validationMessage.x = request.x;
                validationMessage.y = request.y
                validationMessage.visible = true;
             case FormValidationMessageRequest.Move:
             case FormValidationMessageRequest.Hide:
                validationMessage.visible = false;
    // ...

Property Documentation

accepted : bool

Indicates whether the form validation request has been accepted by the signal handler.

If the property is false after any signal handlers for WebEngineView::validationMessageRequested have been executed, a default file validation message will be shown. To prevent this, set request.accepted to true.

The default is false.

[read-only] anchor : rectangle

An anchor of an element in the viewport for which the form validation message should be displayed.

[read-only] subText : bool

The subtext of the form validation message.

[read-only] text : bool

The text of the form validation message.

[read-only] type : enumeration

The type of the form validation message request.

ValidationMessageRequest.ShowThe form validation message should be shown.
ValidationMessageRequest.HideThe form validation message should be hidden.
ValidationMessageRequest.MoveThe form validation message should be moved.

© 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.