MenuBar QML QtQuick.Controls 1.0


import QtQuick 2.0
import QtQuick.Controls 1.0
Item {
  MenuBar {
    id: ee
    Menu {
        title: "File"
        MenuItem { text: "Open..." }
        MenuItem { text: "Close" }
    }
    Menu {
        title: "Edit"
        MenuItem { text: "Cut" }
        MenuItem { text: "Copy" }
        MenuItem { text: "Paste" }
    }
  }
}

我希望看到菜单栏作为输出,但我一无所获。请指出我错过了什么。

你需要 ApplicationWindow。请参阅那里的示例

最新更新