ActionGroup QML Type
함께 작업을 그룹화합니다. 더 보기...
Import Statement: | import QtQuick.Controls |
Inherits: |
속성
- actions : list<Action>
- checkedAction : Action
- enabled : bool
- exclusive : bool
첨부 속성
- group : ActionGroup
신호
- triggered(Action action)
방법
- void addAction(Action action)
- void removeAction(Action action)
상세 설명
액션 그룹은 시각적이지 않은 액션 그룹입니다. 상호 exclusive 액션 그룹은 한 번에 하나의 옵션만 선택할 수 있는 액션과 함께 사용됩니다.
ActionGroup을 사용하는 가장 간단한 방법은 액션을 그룹의 자식으로 선언하는 것입니다.
ActionGroup { id: alignmentGroup Action { checked: true checkable: true text: qsTr("Left") } Action { checkable: true text: qsTr("Center") } Action { checkable: true text: qsTr("Right") } }
또는 group 첨부 속성을 사용하여 다른 곳에 액션을 선언하고 특정 그룹에 할당할 수 있습니다.
ActionGroup { id: alignmentGroup } Action { checked: true checkable: true text: qsTr("Left") ActionGroup.group: alignmentGroup } Action { checkable: true text: qsTr("Center") ActionGroup.group: alignmentGroup } Action { checkable: true text: qsTr("Right") ActionGroup.group: alignmentGroup }
보다 고급 사용 사례는 addAction()
및 removeAction()
메서드를 사용하여 처리할 수 있습니다.
Action 및 ButtonGroup도 참조하세요 .
속성 문서
checkedAction : Action |
이 속성은 독점 그룹에서 현재 선택된 작업을 보유하며, 그룹이 없거나 그룹이 비독점인 경우 null
을 보유합니다.
기본적으로 이 속성은 독점 액션 그룹에 추가된 첫 번째 체크된 액션입니다.
exclusive도 참조하세요 .
enabled : bool |
이 속성은 작업 그룹이 활성화되었는지 여부를 보유합니다. 기본값은 true
입니다.
이 속성이 false
인 경우 그룹의 모든 작업이 비활성화됩니다. 이 속성이 true
인 경우 명시적으로 비활성화하지 않는 한 그룹의 모든 작업이 활성화됩니다.
exclusive : bool |
이 속성은 작업 그룹이 독점적인지 여부를 보유합니다. 기본값은 true
입니다.
이 속성이 true
인 경우 그룹에서 한 번에 하나의 작업만 확인할 수 있습니다. 사용자는 아무 작업이나 트리거하여 확인할 수 있으며, 해당 작업은 그룹에서 기존 작업을 확인된 작업으로 대체합니다.
독점 그룹에서는 사용자가 현재 체크된 작업을 트리거하여 체크된 작업을 해제할 수 없으며, 해당 그룹에 대해 새로 체크된 작업을 설정하려면 그룹의 다른 작업을 트리거해야 합니다.
비독점 그룹에서는 동작을 선택하거나 선택 취소해도 그룹의 다른 동작에는 영향을 미치지 않습니다. 또한 checkedAction 속성 값은 null
입니다.
첨부된 속성 문서
ActionGroup.group : ActionGroup |
이 속성은 액션을 액션 그룹에 첨부합니다.
ActionGroup { id: group } Action { checked: true text: qsTr("Option A") ActionGroup.group: group } Action { text: qsTr("Option B") ActionGroup.group: group }
actions도 참조하세요 .
신호 문서
triggered(Action action) |
이 신호는 그룹의 action 가 트리거될 때 발생합니다.
이 신호는 같은 그룹의 모든 액션에 대해 공통 신호 처리기를 구현할 때 편리합니다.
ActionGroup { onTriggered: console.log("triggered:", action.text) Action { text: "First" } Action { text: "Second" } Action { text: "Third" } }
참고: 해당 핸들러는 onTriggered
입니다.
Action::triggered()도 참조하세요 .
메서드 문서
void addAction(Action action) |
void removeAction(Action action) |
© 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.