Movatterモバイル変換


[0]ホーム

URL:


Back to Qt.io
Contact UsBlogDownload Qt
Qt documentation

ColorDialogRequest QML Type

A request for selecting a color by the user.More...

Import Statement: import QtWebEngine 1.10
Since: QtWebEngine 1.4

Properties

Methods

Detailed Description

A ColorDialogRequest is passed as an argument of theWebEngineView::colorDialogRequested signal. It is generated when a color picker dialog is requested. SeeHTML5 Color State.

Theaccepted property of the request indicates whether the request is handled by the user code or the default dialog should be displayed. If you set theaccepted property totrue, make sure to call eitherdialogAccept() ordialogReject() afterwards.

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

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 isfalse after any signal handlers forWebEngineView::colorDialogRequested have been executed, a default color picker dialog will be shown. To prevent this, setrequest.accepted totrue.

The default isfalse.


[read-only]color :color

The default color to be selected in the dialog.


Method Documentation

voiddialogAccept(colorcolor)

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


voiddialogReject()

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


© 2025 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 theGNU 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.

Contents

Qt Group includes The Qt Company Oy and its global subsidiaries and affiliates.


[8]ページ先頭

©2009-2025 Movatter.jp