WebEngineAction QML Type
WebEngineView::WebAction.. . 더보기...
Import Statement: | import QtWebEngine |
Since: | QtWebEngine 1.8 |
속성
방법
- void trigger()
상세 설명
웹엔진 액션은 WebEngineView::action() 메서드에 의해 반환됩니다. 이 메서드는 enabled 와 같은 액션에 대한 정보를 제공합니다.
다음 코드는 WebEngineView::action() 메서드를 사용하여 복사 액션이 활성화되어 있는지 확인합니다:
var copyAction = webEngineView.action(WebEngineView.Copy); if (copyAction.enabled) console.log("Copy is enabled."); else console.log("Copy is disabled.");
ToolButton 은 다음과 같이 WebEngineAction에 연결할 수 있습니다:
ToolButton { property int itemAction: WebEngineView.Back text: webEngineView.action(itemAction).text enabled: webEngineView.action(itemAction).enabled onClicked: webEngineView.action(itemAction).trigger() icon.name: webEngineView.action(itemAction).iconName display: AbstractButton.TextUnderIcon }
컨텍스트 메뉴는 다음과 같이 구현할 수 있습니다:
property Menu contextMenu: Menu { Repeater { model: [ WebEngineView.Back, WebEngineView.Forward, WebEngineView.Reload, WebEngineView.SavePage, WebEngineView.Copy, WebEngineView.Paste, WebEngineView.Cut, WebEngineView.ChangeTextDirectionLTR, WebEngineView.ChangeTextDirectionRTL, ] MenuItem { text: webEngineView.action(modelData).text enabled: webEngineView.action(modelData).enabled onClicked: webEngineView.action(modelData).trigger() icon.name: webEngineView.action(modelData).iconName display: MenuItem.TextBesideIcon } } } onContextMenuRequested: function(request) { if (customContextMenuOption.checked) { request.accepted = true; contextMenu.popup(); } }
프로퍼티 문서
enabled : bool |
이 속성은 액션이 활성화되었는지 여부를 보유합니다.
iconName : string |
이 속성에는 액션의 아이콘 이름이 저장됩니다. 이 이름은 테마에서 아이콘을 선택하는 데 사용할 수 있습니다.
text : int |
이 속성에는 작업에 대한 텍스트 설명이 포함됩니다.
메서드 문서
void trigger() |
액션을 트리거합니다.
© 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.