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.accepted をtrue に設定する。
デフォルトはfalse です。
text : bool [read-only]
ツールチップのテキスト。ツールチップを非表示にする場合は、空の文字列が格納されます。
type : enumeration [read-only]
ツールチップ要求のタイプ。
| 定数 | 説明 |
|---|---|
TooltipRequest.Show | ツールチップを表示する |
TooltipRequest.Hide | ツールチップは隠されるべきである。 |
x : int [read-only]
要求されたツールチップの左上隅の x 座標。
y : int [read-only]
要求されたツールチップの左上隅のy座標。
© 2026 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.