IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

ColorDialogRequest QML Type

A request for selecting a color by the user.

This type was introduced in QtWebEngine 1.4.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ColorDialogRequest QML Type

  • Import Statement: import QtWebEngine

  • Since:: QtWebEngine 1.4

Detailed Description

A ColorDialogRequest is passed as an argument of the WebEngineView::colorDialogRequested signal. It is generated when a color picker dialog is requested. See HTML5 Color State.

The accepted property of the request indicates whether the request is handled by the user code or the default dialog should be displayed. If you set the accepted property to true, make sure to call either dialogAccept() or dialogReject() afterwards.

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

 
Sélectionnez
WebEngineView {
    // ...
    onColorDialogRequested: function(request) {
        request.accepted = true;
        myDialog.request = request // keep the reference to the request
        myDialog.accept.connect(request.dialogAccept);
        myDialog.reject.connect(request.dialogReject);
        myDialog.visible = true;
    }
    // ...
}

Property Documentation

 

accepted : bool

Indicates whether the color picker dialog request has been accepted by the signal handler.

If the property is false after any signal handlers for WebEngineView::colorDialogRequested have been executed, a default color picker dialog will be shown. To prevent this, set request.accepted to true.

The default is false.

[read-only] color : color

The default color to be selected in the dialog.

Method Documentation

 

void dialogAccept(color color)

This function notifies the engine that the user accepted the dialog, providing the color.

void dialogReject()

This function notifies the engine that the user rejected the dialog.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+