QML的Window与ApplicationWindow

来源:互联网 发布:原始传奇光翼进阶数据 编辑:程序博客网 时间:2024/05/16 15:27

Qt Quick中ApplicationWindow与Window

ApplicationWindow需要导入QtQuick.Controls
Window需要导入QtQuick.Window 。
默认不可见,需要设置visible:true才可见。
主要区别就是ApplicationWindow提供了简单的方式创建程序窗口,因为其有属性menuBar、toolBar、Tabview等属性,可以方便快速创建一个丰富的窗口。

  ApplicationWindow {      id: window      visible: true      menuBar: MenuBar {          Menu { MenuItem {...} }          Menu { MenuItem {...} }      }      toolBar: ToolBar {          RowLayout {              anchors.fill: parent              ToolButton {...}          }      }      TabView {          id: myContent          anchors.fill: parent          ...      }  }
原创粉丝点击