TooltipRequest QML Type

ユーザーにツールチップを表示するリクエスト。もっと見る...

Import Statement: import QtWebEngine
Since: QtWebEngine 1.10

プロパティ

詳細説明

TooltipRequestは、WebEngineView::tooltipRequested シグナルのパラメータとして渡されるリクエスト・オブジェクトです。onTooltipRequested シグナルハンドラを使用して、特定の位置でカスタムツールチップメニューの要求を処理します。

リクエストのaccepted プロパティは、リクエストをユーザーコードで処理するか、デフォルトのツールチップを表示するかを示します。

以下のコードでは、カスタム・ツールチップを使ってリクエストを処理しています:

WebEngineView {
    // ...
    onTooltipRequested: function(request) {
        if (request.type == TooltipRequest.Show) {
            tooltip.visible = true;
            tooltip.x = request.x;
            tooltip.y = request.y;
            tooltip.text = request.text;
        } else {
            tooltip.visible = false;
        }
        request.accepted = true;
    }
    // ...
}

プロパティの説明

accepted : bool

ツールチップ要求がシグナルハンドラによって受け入れられたかどうかを示します。

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

デフォルトはfalse です。


text : bool [read-only]

ツールチップのテキスト。ツールチップを非表示にする場合は、空の文字列が含まれます。


type : enumeration [read-only]

ツールチップ要求のタイプ。

定数説明
TooltipRequest.Showツールチップは表示されるべきです。
TooltipRequest.Hideツールチップは隠されるべきである。

x : int [read-only]

要求されたツールチップの左上隅のx座標。


y : int [read-only]

ツールチップの左上隅のy座標。


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