MenuBar QML Type

기본 메뉴바. 더 보기...

Import Statement: import Qt.labs.platform
Inherits:

QtObject

속성

방법

상세 설명

메뉴바 유형은 네이티브 플랫폼 메뉴바를 위한 QML API를 제공합니다.

메뉴 모음은 드롭다운 메뉴 목록으로 구성됩니다.

MenuBar {
    id: menuBar

    Menu {
        id: fileMenu
        title: qsTr("File")
        // ...
    }

    Menu {
        id: editMenu
        title: qsTr("&Edit")
        // ...
    }

    Menu {
        id: viewMenu
        title: qsTr("&View")
        // ...
    }

    Menu {
        id: helpMenu
        title: qsTr("&Help")
        // ...
    }
}

MenuBar는 현재 다음 플랫폼에서 사용할 수 있습니다:

  • macOS
  • Android
  • Linux(글로벌 D-Bus 메뉴 표시줄을 제공하는 데스크톱 환경에서만 사용 가능)
  • Windows

참고: Qt.labs 모듈의 유형은 향후 버전에서 호환성을 보장하지 않습니다.

Menu참조하세요 .

속성 문서

data : list<QtObject> [default]

이 기본 속성에는 메뉴 표시줄의 자식으로 선언된 모든 객체 목록이 저장됩니다. 데이터 속성에는 TimerQtObject 과 같이 Menu 인스턴스가 아닌 객체가 포함됩니다.

menus도 참조하세요 .


이 속성은 메뉴 표시줄의 메뉴 목록을 보유합니다.


window : Window

이 속성은 메뉴 표시줄의 창을 보유합니다.

명시적으로 설정하지 않는 한 창이 있는 Window 또는 Item 을 찾을 때까지 QML 부모 객체를 반복하여 창이 자동으로 확인됩니다.


메서드 문서

void addMenu(Menu menu)

메뉴 모음 끝에 menu 을 추가합니다.


void clear()

메뉴 모음에서 모든 메뉴를 제거합니다.


void insertMenu(int index, Menu menu)

메뉴 표시줄의 지정된 index 위치에 menu 을 삽입합니다.


void removeMenu(Menu menu)

메뉴 모음에서 menu 을 제거합니다.


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