TooltipRequest QML Type

사용자에게 툴팁을 표시하기 위한 요청입니다. 더 보기...

Import Statement: import QtWebEngine
Since: QtWebEngine 1.10

속성

상세 설명

툴팁 요청은 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.