Shortcut QML Type

키보드 단축키를 제공합니다. 더 보기...

Import Statement: import QtQuick

속성

신호

상세 설명

단축키 유형을 사용하면 키보드 단축키를 처리할 수 있습니다. 바로 가기는 standard keyboard shortcuts 중 하나로 설정하거나 바로 가기 activate 에 필요한 최대 4개의 키 누르기 시퀀스를 포함하는 문자열로 설명할 수 있습니다.

Item {
    id: view

    property int currentIndex

    Shortcut {
        sequences: [StandardKey.NextChild]
        onActivated: view.currentIndex++
    }
}

여러 개의 바로 가기 sequences 를 설정하여 여러 개의 다른 키 누름 시퀀스를 통해 activated 이 되도록 할 수도 있습니다.

KeysshortcutOverride()도 참조하세요 .

속성 문서

autoRepeat : bool

이 속성은 바로가기가 자동 반복될 수 있는지 여부를 나타냅니다.

기본값은 true 입니다.


context : enumeration

이 속성은 shortcut context.

지원되는 값은 다음과 같습니다:

Constant설명
Qt.WindowShortcut(기본값) 바로 가기는 상위 항목이 활성 최상위 창에 있을 때 활성화됩니다.
Qt.ApplicationShortcut바로 가기는 애플리케이션의 창 중 하나가 활성화되어 있을 때 활성화됩니다.
Shortcut {
    sequence: StandardKey.Quit
    context: Qt.ApplicationShortcut
    onActivated: Qt.quit()
}

enabled : bool

이 속성은 바로 가기의 활성화 여부를 보유합니다.

기본값은 true 입니다.


nativeText : string [read-only]

이 속성은 바로 가기의 키 시퀀스를 플랫폼별 문자열로 제공합니다. 즉, 번역된 상태로 표시되며 macOS에서는 메뉴 표시줄의 키 시퀀스와 유사하게 표시됩니다. 이 텍스트는 사용자에게 표시하는 것이 가장 좋습니다(예: 툴팁).

sequenceportableText참조하세요 .


portableText : string [read-only]

이 속성은 바로가기의 키 시퀀스를 파일 읽기 및 쓰기에 적합한 "이식 가능한" 형식의 문자열로 제공합니다. 대부분의 경우 Windows 및 X11의 기본 텍스트와 비슷하게 보입니다.

sequencenativeText참조하세요 .


sequence : keysequence

이 속성은 바로가기의 키 시퀀스를 보유합니다. 키 시퀀스는 standard keyboard shortcuts 중 하나로 설정하거나 바로 가기 activate 에 필요한 최대 4개의 키 누름 시퀀스가 포함된 문자열로 설명할 수 있습니다.

기본값은 빈 키 시퀀스입니다.

Shortcut {
    sequence: "Ctrl+E,Ctrl+W"
    onActivated: edit.wrapMode = TextEdit.Wrap
}

참고: 표준 키는 일부 플랫폼에서는 하나의 바로 가기로 확인되지만 다른 플랫폼에서는 여러 개의 바로 가기로 확인될 수 있으므로 표준 키에는 항상 sequences 을 사용하는 것이 좋습니다.

sequences도 참조하세요 .


sequences : list<keysequence>

이 속성은 바로가기에 대한 여러 개의 키 시퀀스를 보유합니다. 키 시퀀스는 standard keyboard shortcuts 중 하나로 설정하거나 바로 가기 activate 에 필요한 최대 4개의 키 누르기 시퀀스를 포함하는 문자열로 설명할 수 있습니다.

Shortcut {
    sequences: [StandardKey.Cut, "Ctrl+X", "Shift+Del"]
    onActivated: edit.cut()
}

신호 문서

activated()

이 신호는 바로가기가 활성화될 때 발생합니다.

참고: 해당 핸들러는 onActivated 입니다.


activatedAmbiguously()

이 신호는 바로가기가 모호하게 활성화된 경우, 즉 두 개 이상의 바로가기의 시작과 일치할 때 발생합니다.

참고: 해당 핸들러는 onActivatedAmbiguously 입니다.


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