ColorDialogRequest QML Type

ユーザーによる色の選択要求。もっと見る...

Import Statement: import QtWebEngine
Since: QtWebEngine 1.4

プロパティ

方法

詳細説明

ColorDialogRequestは、WebEngineView::colorDialogRequested シグナルの引数として渡されます。カラーピッカーダイアログが要求されたときに生成されます。HTML5 Color Stateを参照してください。

リクエストのaccepted プロパティは、リクエストをユーザーコードで処理するか、デフォルトのダイアログを表示するかを示します。accepted プロパティをtrue に設定した場合は、その後に必ずdialogAccept() またはdialogReject() を呼び出してください。

以下のコードでは、カスタムダイアログを使用してリクエストを処理しています:

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;
    }
    // ...
}

プロパティの説明

accepted : bool

カラーピッカーダイアログ要求がシグナルハンドラに受け入れられたかどうかを示す。

WebEngineView::colorDialogRequested のシグナルハンドラが実行された後、このプロパティがfalse である場合、デフォルトのカラーピッカーダイアログが表示されます。これを防ぐには、request.acceptedtrue に設定します。

デフォルトはfalse です。


color : color [read-only]

ダイアログで選択されるデフォルトの色。


メソッド ドキュメント

void dialogAccept(color color)

この関数は、ユーザーがダイアログを受け入れたことをエンジンに通知し、color を提供します。


void dialogReject()

この関数は、ユーザーがダイアログを拒否したことをエンジンに通知します。


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