이 페이지에서

MenuBar QML Type

기본 메뉴 막대. 더 보기...

Import Statement: import Qt.labs.platform
Inherits:

QtObject

속성

방법

상세 설명

MenuBar 유형은 네이티브 플랫폼 메뉴바를 위한 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]

이 기본 속성은 메뉴바의 자식 요소로 선언된 모든 객체의 목록을 포함합니다. data 속성에는 Menu 인스턴스가 아닌 객체(예: Timer 및 QtObject)도 포함됩니다.

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 ’을 제거합니다.

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